mirror of https://github.com/jellyfin/jellyfin.git
Only allow owner and admin to delete playlists
This commit is contained in:
parent
9031aae653
commit
ddda30fe23
|
@ -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…
Reference in New Issue