UserPolicy.cs 6.1 KB

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