mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-03-30 07:47:46 +02: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();
|
$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)
|
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()
|
public function getUrlAttribute()
|
||||||
|
|
Loading…
Add table
Reference in a new issue