UserPolicy.cs 5.0 KB

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