UserPolicy.cs 5.2 KB

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