UserPolicy.cs 5.3 KB

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