mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-25 06:27:59 +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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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