From a86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Thu, 27 Dec 2018 18:27:57 -0500 Subject: Add GPL modules --- MediaBrowser.Model/Users/ForgotPasswordAction.cs | 10 ++ MediaBrowser.Model/Users/ForgotPasswordResult.cs | 23 +++++ MediaBrowser.Model/Users/PinRedeemResult.cs | 17 ++++ MediaBrowser.Model/Users/UserAction.cs | 15 +++ MediaBrowser.Model/Users/UserActionType.cs | 8 ++ MediaBrowser.Model/Users/UserPolicy.cs | 121 +++++++++++++++++++++++ 6 files changed, 194 insertions(+) create mode 100644 MediaBrowser.Model/Users/ForgotPasswordAction.cs create mode 100644 MediaBrowser.Model/Users/ForgotPasswordResult.cs create mode 100644 MediaBrowser.Model/Users/PinRedeemResult.cs create mode 100644 MediaBrowser.Model/Users/UserAction.cs create mode 100644 MediaBrowser.Model/Users/UserActionType.cs create mode 100644 MediaBrowser.Model/Users/UserPolicy.cs (limited to 'MediaBrowser.Model/Users') diff --git a/MediaBrowser.Model/Users/ForgotPasswordAction.cs b/MediaBrowser.Model/Users/ForgotPasswordAction.cs new file mode 100644 index 0000000000..f75b1d74bf --- /dev/null +++ b/MediaBrowser.Model/Users/ForgotPasswordAction.cs @@ -0,0 +1,10 @@ + +namespace MediaBrowser.Model.Users +{ + public enum ForgotPasswordAction + { + ContactAdmin = 0, + PinCode = 1, + InNetworkRequired = 2 + } +} diff --git a/MediaBrowser.Model/Users/ForgotPasswordResult.cs b/MediaBrowser.Model/Users/ForgotPasswordResult.cs new file mode 100644 index 0000000000..7dbb1e96bd --- /dev/null +++ b/MediaBrowser.Model/Users/ForgotPasswordResult.cs @@ -0,0 +1,23 @@ +using System; + +namespace MediaBrowser.Model.Users +{ + public class ForgotPasswordResult + { + /// + /// Gets or sets the action. + /// + /// The action. + public ForgotPasswordAction Action { get; set; } + /// + /// Gets or sets the pin file. + /// + /// The pin file. + public string PinFile { get; set; } + /// + /// Gets or sets the pin expiration date. + /// + /// The pin expiration date. + public DateTime? PinExpirationDate { get; set; } + } +} diff --git a/MediaBrowser.Model/Users/PinRedeemResult.cs b/MediaBrowser.Model/Users/PinRedeemResult.cs new file mode 100644 index 0000000000..6a01bf2d42 --- /dev/null +++ b/MediaBrowser.Model/Users/PinRedeemResult.cs @@ -0,0 +1,17 @@ + +namespace MediaBrowser.Model.Users +{ + public class PinRedeemResult + { + /// + /// Gets or sets a value indicating whether this is success. + /// + /// true if success; otherwise, false. + public bool Success { get; set; } + /// + /// Gets or sets the users reset. + /// + /// The users reset. + public string[] UsersReset { get; set; } + } +} diff --git a/MediaBrowser.Model/Users/UserAction.cs b/MediaBrowser.Model/Users/UserAction.cs new file mode 100644 index 0000000000..5f401b9f0d --- /dev/null +++ b/MediaBrowser.Model/Users/UserAction.cs @@ -0,0 +1,15 @@ +using System; + +namespace MediaBrowser.Model.Users +{ + public class UserAction + { + public string Id { get; set; } + public string ServerId { get; set; } + public Guid UserId { get; set; } + public Guid ItemId { get; set; } + public UserActionType Type { get; set; } + public DateTime Date { get; set; } + public long? PositionTicks { get; set; } + } +} diff --git a/MediaBrowser.Model/Users/UserActionType.cs b/MediaBrowser.Model/Users/UserActionType.cs new file mode 100644 index 0000000000..493de62729 --- /dev/null +++ b/MediaBrowser.Model/Users/UserActionType.cs @@ -0,0 +1,8 @@ + +namespace MediaBrowser.Model.Users +{ + public enum UserActionType + { + PlayedItem = 0 + } +} diff --git a/MediaBrowser.Model/Users/UserPolicy.cs b/MediaBrowser.Model/Users/UserPolicy.cs new file mode 100644 index 0000000000..8bddafb5a9 --- /dev/null +++ b/MediaBrowser.Model/Users/UserPolicy.cs @@ -0,0 +1,121 @@ +using MediaBrowser.Model.Configuration; +using System; + +namespace MediaBrowser.Model.Users +{ + public class UserPolicy + { + /// + /// Gets or sets a value indicating whether this instance is administrator. + /// + /// true if this instance is administrator; otherwise, false. + public bool IsAdministrator { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is hidden. + /// + /// true if this instance is hidden; otherwise, false. + public bool IsHidden { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is disabled. + /// + /// true if this instance is disabled; otherwise, false. + public bool IsDisabled { get; set; } + + /// + /// Gets or sets the max parental rating. + /// + /// The max parental rating. + public int? MaxParentalRating { get; set; } + + public string[] BlockedTags { get; set; } + public bool EnableUserPreferenceAccess { get; set; } + public AccessSchedule[] AccessSchedules { get; set; } + public UnratedItem[] BlockUnratedItems { get; set; } + public bool EnableRemoteControlOfOtherUsers { get; set; } + public bool EnableSharedDeviceControl { get; set; } + public bool EnableRemoteAccess { get; set; } + + public bool EnableLiveTvManagement { get; set; } + public bool EnableLiveTvAccess { get; set; } + + public bool EnableMediaPlayback { get; set; } + public bool EnableAudioPlaybackTranscoding { get; set; } + public bool EnableVideoPlaybackTranscoding { get; set; } + public bool EnablePlaybackRemuxing { get; set; } + + public bool EnableContentDeletion { get; set; } + public string[] EnableContentDeletionFromFolders { get; set; } + public bool EnableContentDownloading { get; set; } + + /// + /// Gets or sets a value indicating whether [enable synchronize]. + /// + /// true if [enable synchronize]; otherwise, false. + public bool EnableSyncTranscoding { get; set; } + public bool EnableMediaConversion { get; set; } + + public string[] EnabledDevices { get; set; } + public bool EnableAllDevices { get; set; } + + public string[] EnabledChannels { get; set; } + public bool EnableAllChannels { get; set; } + + public string[] EnabledFolders { get; set; } + public bool EnableAllFolders { get; set; } + + public int InvalidLoginAttemptCount { get; set; } + + public bool EnablePublicSharing { get; set; } + + public string[] BlockedMediaFolders { get; set; } + public string[] BlockedChannels { get; set; } + + public int RemoteClientBitrateLimit { get; set; } + public string AuthenticationProviderId { get; set; } + + public UserPolicy() + { + EnableContentDeletion = true; + EnableContentDeletionFromFolders = new string[] { }; + + EnableSyncTranscoding = true; + EnableMediaConversion = true; + + EnableMediaPlayback = true; + EnableAudioPlaybackTranscoding = true; + EnableVideoPlaybackTranscoding = true; + EnablePlaybackRemuxing = true; + + EnableLiveTvManagement = true; + EnableLiveTvAccess = true; + + // Without this on by default, admins won't be able to do this + // Improve in the future + EnableLiveTvManagement = true; + + EnableSharedDeviceControl = true; + + BlockedTags = new string[] { }; + BlockUnratedItems = new UnratedItem[] { }; + + EnableUserPreferenceAccess = true; + + AccessSchedules = new AccessSchedule[] { }; + + EnableAllChannels = true; + EnabledChannels = new string[] { }; + + EnableAllFolders = true; + EnabledFolders = new string[] { }; + + EnabledDevices = new string[] { }; + EnableAllDevices = true; + + EnableContentDownloading = true; + EnablePublicSharing = true; + EnableRemoteAccess = true; + } + } +} \ No newline at end of file -- cgit v1.2.3