diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2024-04-10 12:52:01 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-10 12:52:01 -0400 |
| commit | ee1d6332ee720ceeccc7b051465ce61a6628b3dc (patch) | |
| tree | c5fe5b5f3075bc69b1f0dcd499c3e95e365a3fbd /MediaBrowser.Model/Entities | |
| parent | dc74bc361d586130ed04b24d85456013975d9f44 (diff) | |
| parent | ddda30fe23a04e07401bc870ac33213ff8a34c71 (diff) | |
Merge pull request #11220 from Shadowghost/add-playlist-acl-api
Add playlist ACL endpoints
Diffstat (limited to 'MediaBrowser.Model/Entities')
| -rw-r--r-- | MediaBrowser.Model/Entities/IHasShares.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/PlaylistUserPermissions.cs | 30 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/Share.cs | 17 |
3 files changed, 34 insertions, 19 deletions
diff --git a/MediaBrowser.Model/Entities/IHasShares.cs b/MediaBrowser.Model/Entities/IHasShares.cs index b34d1a037..8c4ba6c42 100644 --- a/MediaBrowser.Model/Entities/IHasShares.cs +++ b/MediaBrowser.Model/Entities/IHasShares.cs @@ -1,4 +1,6 @@ -namespace MediaBrowser.Model.Entities; +using System.Collections.Generic; + +namespace MediaBrowser.Model.Entities; /// <summary> /// Interface for access to shares. @@ -8,5 +10,5 @@ public interface IHasShares /// <summary> /// Gets or sets the shares. /// </summary> - Share[] Shares { get; set; } + IReadOnlyList<PlaylistUserPermissions> Shares { get; set; } } diff --git a/MediaBrowser.Model/Entities/PlaylistUserPermissions.cs b/MediaBrowser.Model/Entities/PlaylistUserPermissions.cs new file mode 100644 index 000000000..b5f017d2b --- /dev/null +++ b/MediaBrowser.Model/Entities/PlaylistUserPermissions.cs @@ -0,0 +1,30 @@ +using System; + +namespace MediaBrowser.Model.Entities; + +/// <summary> +/// Class to hold data on user permissions for playlists. +/// </summary> +public class PlaylistUserPermissions +{ + /// <summary> + /// Initializes a new instance of the <see cref="PlaylistUserPermissions"/> class. + /// </summary> + /// <param name="userId">The user id.</param> + /// <param name="canEdit">Edit permission.</param> + public PlaylistUserPermissions(Guid userId, bool canEdit = false) + { + UserId = userId; + CanEdit = canEdit; + } + + /// <summary> + /// Gets or sets the user id. + /// </summary> + public Guid UserId { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether the user has edit permissions. + /// </summary> + public bool CanEdit { get; set; } +} diff --git a/MediaBrowser.Model/Entities/Share.cs b/MediaBrowser.Model/Entities/Share.cs deleted file mode 100644 index 186aad189..000000000 --- a/MediaBrowser.Model/Entities/Share.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace MediaBrowser.Model.Entities; - -/// <summary> -/// Class to hold data on sharing permissions. -/// </summary> -public class Share -{ - /// <summary> - /// Gets or sets the user id. - /// </summary> - public string? UserId { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether the user has edit permissions. - /// </summary> - public bool CanEdit { get; set; } -} |
