UserPolicy.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #pragma warning disable CS1591
  2. using System;
  3. using MediaBrowser.Model.Configuration;
  4. namespace MediaBrowser.Model.Users
  5. {
  6. public class UserPolicy
  7. {
  8. /// <summary>
  9. /// Gets or sets a value indicating whether this instance is administrator.
  10. /// </summary>
  11. /// <value><c>true</c> if this instance is administrator; otherwise, <c>false</c>.</value>
  12. public bool IsAdministrator { get; set; }
  13. /// <summary>
  14. /// Gets or sets a value indicating whether this instance is hidden.
  15. /// </summary>
  16. /// <value><c>true</c> if this instance is hidden; otherwise, <c>false</c>.</value>
  17. public bool IsHidden { get; set; }
  18. /// <summary>
  19. /// Gets or sets a value indicating whether this instance is disabled.
  20. /// </summary>
  21. /// <value><c>true</c> if this instance is disabled; otherwise, <c>false</c>.</value>
  22. public bool IsDisabled { get; set; }
  23. /// <summary>
  24. /// Gets or sets the max parental rating.
  25. /// </summary>
  26. /// <value>The max parental rating.</value>
  27. public int? MaxParentalRating { get; set; }
  28. public string[] BlockedTags { get; set; }
  29. public bool EnableUserPreferenceAccess { get; set; }
  30. public AccessSchedule[] AccessSchedules { get; set; }
  31. public UnratedItem[] BlockUnratedItems { get; set; }
  32. public bool EnableRemoteControlOfOtherUsers { get; set; }
  33. public bool EnableSharedDeviceControl { get; set; }
  34. public bool EnableRemoteAccess { get; set; }
  35. public bool EnableLiveTvManagement { get; set; }
  36. public bool EnableLiveTvAccess { get; set; }
  37. public bool EnableMediaPlayback { get; set; }
  38. public bool EnableAudioPlaybackTranscoding { get; set; }
  39. public bool EnableVideoPlaybackTranscoding { get; set; }
  40. public bool EnablePlaybackRemuxing { get; set; }
  41. public bool ForceRemoteSourceTranscoding { get; set; }
  42. public bool EnableContentDeletion { get; set; }
  43. public string[] EnableContentDeletionFromFolders { get; set; }
  44. public bool EnableContentDownloading { get; set; }
  45. /// <summary>
  46. /// Gets or sets a value indicating whether [enable synchronize].
  47. /// </summary>
  48. /// <value><c>true</c> if [enable synchronize]; otherwise, <c>false</c>.</value>
  49. public bool EnableSyncTranscoding { get; set; }
  50. public bool EnableMediaConversion { get; set; }
  51. public string[] EnabledDevices { get; set; }
  52. public bool EnableAllDevices { get; set; }
  53. public string[] EnabledChannels { get; set; }
  54. public bool EnableAllChannels { get; set; }
  55. public string[] EnabledFolders { get; set; }
  56. public bool EnableAllFolders { get; set; }
  57. public int InvalidLoginAttemptCount { get; set; }
  58. public int LoginAttemptsBeforeLockout { get; set; }
  59. public bool EnablePublicSharing { get; set; }
  60. public string[] BlockedMediaFolders { get; set; }
  61. public string[] BlockedChannels { get; set; }
  62. public int RemoteClientBitrateLimit { get; set; }
  63. public string AuthenticationProviderId { get; set; }
  64. public string PasswordResetProviderId { get; set; }
  65. public UserPolicy()
  66. {
  67. IsHidden = true;
  68. EnableContentDeletion = false;
  69. EnableContentDeletionFromFolders = Array.Empty<string>();
  70. EnableSyncTranscoding = true;
  71. EnableMediaConversion = true;
  72. EnableMediaPlayback = true;
  73. EnableAudioPlaybackTranscoding = true;
  74. EnableVideoPlaybackTranscoding = true;
  75. EnablePlaybackRemuxing = true;
  76. ForceRemoteSourceTranscoding = false;
  77. EnableLiveTvManagement = true;
  78. EnableLiveTvAccess = true;
  79. // Without this on by default, admins won't be able to do this
  80. // Improve in the future
  81. EnableLiveTvManagement = true;
  82. EnableSharedDeviceControl = true;
  83. BlockedTags = Array.Empty<string>();
  84. BlockUnratedItems = Array.Empty<UnratedItem>();
  85. EnableUserPreferenceAccess = true;
  86. AccessSchedules = Array.Empty<AccessSchedule>();
  87. LoginAttemptsBeforeLockout = -1;
  88. EnableAllChannels = true;
  89. EnabledChannels = Array.Empty<string>();
  90. EnableAllFolders = true;
  91. EnabledFolders = Array.Empty<string>();
  92. EnabledDevices = Array.Empty<string>();
  93. EnableAllDevices = true;
  94. EnableContentDownloading = true;
  95. EnablePublicSharing = true;
  96. EnableRemoteAccess = true;
  97. }
  98. }
  99. }