diff --git a/app/Commands/EditPlaylistCommand.php b/app/Commands/EditPlaylistCommand.php index abe13e25..877b88c6 100644 --- a/app/Commands/EditPlaylistCommand.php +++ b/app/Commands/EditPlaylistCommand.php @@ -45,7 +45,7 @@ class EditPlaylistCommand extends CommandBase { $user = Auth::user(); - return $this->_playlist && $user != null && $this->_playlist->user_id == $user->id; + return $this->_playlist && $user != null && ($this->_playlist->user_id == $user->id || $user->hasRole('admin')); } /** diff --git a/app/Models/Playlist.php b/app/Models/Playlist.php index a60d24c4..4ca4f004 100644 --- a/app/Models/Playlist.php +++ b/app/Models/Playlist.php @@ -134,7 +134,7 @@ class Playlist extends Model implements Searchable, Commentable, Favouritable if (in_array($name, Track::$LosslessFormats) && !$playlist->hasLosslessTracksOnly() && !$playlist->hasLosslessTracks()) { continue; } - + $formats[] = [ 'name' => $name, 'extension' => $format['extension'], @@ -284,7 +284,7 @@ class Playlist extends Model implements Searchable, Commentable, Favouritable public function canView($user) { - return $this->is_public || ($user != null && $user->id == $this->user_id); + return $this->is_public || ($user != null && $user->id == $this->user_id) || ($user != null && $user->hasRole('admin')); } public function getUrlAttribute()