mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-21 20:48:00 +01:00
Admins can see all playlists
This commit is contained in:
parent
0e6afe372b
commit
337caa23a8
2 changed files with 3 additions and 3 deletions
|
@ -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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue