UserPolicy.cs 5.7 KB

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