UserPolicy.cs 5.7 KB

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