UserPolicy.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #pragma warning disable CS1591
  2. #pragma warning disable SA1600
  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. public UserPolicy()
  67. {
  68. IsHidden = true;
  69. EnableContentDeletion = false;
  70. EnableContentDeletionFromFolders = Array.Empty<string>();
  71. EnableSyncTranscoding = true;
  72. EnableMediaConversion = true;
  73. EnableMediaPlayback = true;
  74. EnableAudioPlaybackTranscoding = true;
  75. EnableVideoPlaybackTranscoding = true;
  76. EnablePlaybackRemuxing = true;
  77. ForceRemoteSourceTranscoding = false;
  78. EnableLiveTvManagement = true;
  79. EnableLiveTvAccess = true;
  80. // Without this on by default, admins won't be able to do this
  81. // Improve in the future
  82. EnableLiveTvManagement = true;
  83. EnableSharedDeviceControl = true;
  84. BlockedTags = Array.Empty<string>();
  85. BlockUnratedItems = Array.Empty<UnratedItem>();
  86. EnableUserPreferenceAccess = true;
  87. AccessSchedules = Array.Empty<AccessSchedule>();
  88. LoginAttemptsBeforeLockout = -1;
  89. EnableAllChannels = true;
  90. EnabledChannels = Array.Empty<string>();
  91. EnableAllFolders = true;
  92. EnabledFolders = Array.Empty<string>();
  93. EnabledDevices = Array.Empty<string>();
  94. EnableAllDevices = true;
  95. EnableContentDownloading = true;
  96. EnablePublicSharing = true;
  97. EnableRemoteAccess = true;
  98. }
  99. }
  100. }