| | 1 | | #nullable disable |
| | 2 | | #pragma warning disable CS1591, CA1819 |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | | using System.ComponentModel; |
| | 6 | | using System.ComponentModel.DataAnnotations; |
| | 7 | | using System.Xml.Serialization; |
| | 8 | | using Jellyfin.Data.Enums; |
| | 9 | | using AccessSchedule = Jellyfin.Data.Entities.AccessSchedule; |
| | 10 | |
|
| | 11 | | namespace MediaBrowser.Model.Users |
| | 12 | | { |
| | 13 | | public class UserPolicy |
| | 14 | | { |
| | 15 | | public UserPolicy() |
| | 16 | | { |
| 149 | 17 | | IsHidden = true; |
| 149 | 18 | | EnableCollectionManagement = false; |
| 149 | 19 | | EnableSubtitleManagement = false; |
| | 20 | |
|
| 149 | 21 | | EnableContentDeletion = false; |
| 149 | 22 | | EnableContentDeletionFromFolders = Array.Empty<string>(); |
| | 23 | |
|
| 149 | 24 | | EnableSyncTranscoding = true; |
| 149 | 25 | | EnableMediaConversion = true; |
| | 26 | |
|
| 149 | 27 | | EnableMediaPlayback = true; |
| 149 | 28 | | EnableAudioPlaybackTranscoding = true; |
| 149 | 29 | | EnableVideoPlaybackTranscoding = true; |
| 149 | 30 | | EnablePlaybackRemuxing = true; |
| 149 | 31 | | ForceRemoteSourceTranscoding = false; |
| 149 | 32 | | EnableLiveTvManagement = true; |
| 149 | 33 | | EnableLiveTvAccess = true; |
| | 34 | |
|
| | 35 | | // Without this on by default, admins won't be able to do this |
| | 36 | | // Improve in the future |
| 149 | 37 | | EnableLiveTvManagement = true; |
| | 38 | |
|
| 149 | 39 | | EnableSharedDeviceControl = true; |
| | 40 | |
|
| 149 | 41 | | BlockedTags = Array.Empty<string>(); |
| 149 | 42 | | AllowedTags = Array.Empty<string>(); |
| 149 | 43 | | BlockUnratedItems = Array.Empty<UnratedItem>(); |
| | 44 | |
|
| 149 | 45 | | EnableUserPreferenceAccess = true; |
| | 46 | |
|
| 149 | 47 | | AccessSchedules = Array.Empty<AccessSchedule>(); |
| | 48 | |
|
| 149 | 49 | | LoginAttemptsBeforeLockout = -1; |
| | 50 | |
|
| 149 | 51 | | MaxActiveSessions = 0; |
| 149 | 52 | | MaxParentalRating = null; |
| | 53 | |
|
| 149 | 54 | | EnableAllChannels = true; |
| 149 | 55 | | EnabledChannels = Array.Empty<Guid>(); |
| | 56 | |
|
| 149 | 57 | | EnableAllFolders = true; |
| 149 | 58 | | EnabledFolders = Array.Empty<Guid>(); |
| | 59 | |
|
| 149 | 60 | | EnabledDevices = Array.Empty<string>(); |
| 149 | 61 | | EnableAllDevices = true; |
| | 62 | |
|
| 149 | 63 | | EnableContentDownloading = true; |
| 149 | 64 | | EnablePublicSharing = true; |
| 149 | 65 | | EnableRemoteAccess = true; |
| 149 | 66 | | SyncPlayAccess = SyncPlayUserAccessType.CreateAndJoinGroups; |
| 149 | 67 | | } |
| | 68 | |
|
| | 69 | | /// <summary> |
| | 70 | | /// Gets or sets a value indicating whether this instance is administrator. |
| | 71 | | /// </summary> |
| | 72 | | /// <value><c>true</c> if this instance is administrator; otherwise, <c>false</c>.</value> |
| | 73 | | public bool IsAdministrator { get; set; } |
| | 74 | |
|
| | 75 | | /// <summary> |
| | 76 | | /// Gets or sets a value indicating whether this instance is hidden. |
| | 77 | | /// </summary> |
| | 78 | | /// <value><c>true</c> if this instance is hidden; otherwise, <c>false</c>.</value> |
| | 79 | | public bool IsHidden { get; set; } |
| | 80 | |
|
| | 81 | | /// <summary> |
| | 82 | | /// Gets or sets a value indicating whether this instance can manage collections. |
| | 83 | | /// </summary> |
| | 84 | | /// <value><c>true</c> if this instance is hidden; otherwise, <c>false</c>.</value> |
| | 85 | | [DefaultValue(false)] |
| | 86 | | public bool EnableCollectionManagement { get; set; } |
| | 87 | |
|
| | 88 | | /// <summary> |
| | 89 | | /// Gets or sets a value indicating whether this instance can manage subtitles. |
| | 90 | | /// </summary> |
| | 91 | | /// <value><c>true</c> if this instance is allowed; otherwise, <c>false</c>.</value> |
| | 92 | | [DefaultValue(false)] |
| | 93 | | public bool EnableSubtitleManagement { get; set; } |
| | 94 | |
|
| | 95 | | /// <summary> |
| | 96 | | /// Gets or sets a value indicating whether this user can manage lyrics. |
| | 97 | | /// </summary> |
| | 98 | | [DefaultValue(false)] |
| | 99 | | public bool EnableLyricManagement { get; set; } |
| | 100 | |
|
| | 101 | | /// <summary> |
| | 102 | | /// Gets or sets a value indicating whether this instance is disabled. |
| | 103 | | /// </summary> |
| | 104 | | /// <value><c>true</c> if this instance is disabled; otherwise, <c>false</c>.</value> |
| | 105 | | public bool IsDisabled { get; set; } |
| | 106 | |
|
| | 107 | | /// <summary> |
| | 108 | | /// Gets or sets the max parental rating. |
| | 109 | | /// </summary> |
| | 110 | | /// <value>The max parental rating.</value> |
| | 111 | | public int? MaxParentalRating { get; set; } |
| | 112 | |
|
| | 113 | | public string[] BlockedTags { get; set; } |
| | 114 | |
|
| | 115 | | public string[] AllowedTags { get; set; } |
| | 116 | |
|
| | 117 | | public bool EnableUserPreferenceAccess { get; set; } |
| | 118 | |
|
| | 119 | | public AccessSchedule[] AccessSchedules { get; set; } |
| | 120 | |
|
| | 121 | | public UnratedItem[] BlockUnratedItems { get; set; } |
| | 122 | |
|
| | 123 | | public bool EnableRemoteControlOfOtherUsers { get; set; } |
| | 124 | |
|
| | 125 | | public bool EnableSharedDeviceControl { get; set; } |
| | 126 | |
|
| | 127 | | public bool EnableRemoteAccess { get; set; } |
| | 128 | |
|
| | 129 | | public bool EnableLiveTvManagement { get; set; } |
| | 130 | |
|
| | 131 | | public bool EnableLiveTvAccess { get; set; } |
| | 132 | |
|
| | 133 | | public bool EnableMediaPlayback { get; set; } |
| | 134 | |
|
| | 135 | | public bool EnableAudioPlaybackTranscoding { get; set; } |
| | 136 | |
|
| | 137 | | public bool EnableVideoPlaybackTranscoding { get; set; } |
| | 138 | |
|
| | 139 | | public bool EnablePlaybackRemuxing { get; set; } |
| | 140 | |
|
| | 141 | | public bool ForceRemoteSourceTranscoding { get; set; } |
| | 142 | |
|
| | 143 | | public bool EnableContentDeletion { get; set; } |
| | 144 | |
|
| | 145 | | public string[] EnableContentDeletionFromFolders { get; set; } |
| | 146 | |
|
| | 147 | | public bool EnableContentDownloading { get; set; } |
| | 148 | |
|
| | 149 | | /// <summary> |
| | 150 | | /// Gets or sets a value indicating whether [enable synchronize]. |
| | 151 | | /// </summary> |
| | 152 | | /// <value><c>true</c> if [enable synchronize]; otherwise, <c>false</c>.</value> |
| | 153 | | public bool EnableSyncTranscoding { get; set; } |
| | 154 | |
|
| | 155 | | public bool EnableMediaConversion { get; set; } |
| | 156 | |
|
| | 157 | | public string[] EnabledDevices { get; set; } |
| | 158 | |
|
| | 159 | | public bool EnableAllDevices { get; set; } |
| | 160 | |
|
| | 161 | | public Guid[] EnabledChannels { get; set; } |
| | 162 | |
|
| | 163 | | public bool EnableAllChannels { get; set; } |
| | 164 | |
|
| | 165 | | public Guid[] EnabledFolders { get; set; } |
| | 166 | |
|
| | 167 | | public bool EnableAllFolders { get; set; } |
| | 168 | |
|
| | 169 | | public int InvalidLoginAttemptCount { get; set; } |
| | 170 | |
|
| | 171 | | public int LoginAttemptsBeforeLockout { get; set; } |
| | 172 | |
|
| | 173 | | public int MaxActiveSessions { get; set; } |
| | 174 | |
|
| | 175 | | public bool EnablePublicSharing { get; set; } |
| | 176 | |
|
| | 177 | | public Guid[] BlockedMediaFolders { get; set; } |
| | 178 | |
|
| | 179 | | public Guid[] BlockedChannels { get; set; } |
| | 180 | |
|
| | 181 | | public int RemoteClientBitrateLimit { get; set; } |
| | 182 | |
|
| | 183 | | [XmlElement(ElementName = "AuthenticationProviderId")] |
| | 184 | | [Required(AllowEmptyStrings = false)] |
| | 185 | | public string AuthenticationProviderId { get; set; } |
| | 186 | |
|
| | 187 | | [Required(AllowEmptyStrings= false)] |
| | 188 | | public string PasswordResetProviderId { get; set; } |
| | 189 | |
|
| | 190 | | /// <summary> |
| | 191 | | /// Gets or sets a value indicating what SyncPlay features the user can access. |
| | 192 | | /// </summary> |
| | 193 | | /// <value>Access level to SyncPlay features.</value> |
| | 194 | | public SyncPlayUserAccessType SyncPlayAccess { get; set; } |
| | 195 | | } |
| | 196 | | } |