mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-26 06:57:58 +01:00
#18: Make playlist accessible conditional one line
This commit is contained in:
parent
8df11e9616
commit
f69240064a
1 changed files with 1 additions and 5 deletions
|
@ -63,12 +63,8 @@ class PlaylistsController extends Controller
|
||||||
public function getDownload($id, $extension)
|
public function getDownload($id, $extension)
|
||||||
{
|
{
|
||||||
$playlist = Playlist::with('tracks', 'user', 'tracks.album')->find($id);
|
$playlist = Playlist::with('tracks', 'user', 'tracks.album')->find($id);
|
||||||
if (!$playlist || (!$playlist->is_public && !Auth::check())) {
|
if (!$playlist || (!$playlist->is_public && !Auth::check()) || (!$playlist->is_public && ($playlist->user_id !== Auth::user()->id))) {
|
||||||
App::abort(404);
|
App::abort(404);
|
||||||
} elseif (!$playlist->is_public && Auth::check()) {
|
|
||||||
if ($playlist->user_id !== Auth::user()->id) {
|
|
||||||
App::abort(404);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$format = null;
|
$format = null;
|
||||||
|
|
Loading…
Reference in a new issue