mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 14:08:44 -04:00
Only allow owner and admin to delete playlists
This commit is contained in:
parent
9031aae653
commit
ddda30fe23
2 changed files with 6 additions and 1 deletions
|
@ -833,7 +833,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
return CanDelete() && IsAuthorizedToDelete(user, allCollectionFolders);
|
||||
}
|
||||
|
||||
public bool CanDelete(User user)
|
||||
public virtual bool CanDelete(User user)
|
||||
{
|
||||
var allCollectionFolders = LibraryManager.GetUserRootFolder().Children.OfType<Folder>().ToList();
|
||||
|
||||
|
|
|
@ -255,6 +255,11 @@ namespace MediaBrowser.Controller.Playlists
|
|||
return shares.Any(s => s.UserId.Equals(userId));
|
||||
}
|
||||
|
||||
public override bool CanDelete(User user)
|
||||
{
|
||||
return user.HasPermission(PermissionKind.IsAdministrator) || user.Id.Equals(OwnerUserId);
|
||||
}
|
||||
|
||||
public override bool IsVisibleStandalone(User user)
|
||||
{
|
||||
if (!IsSharedItem)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue