diff --git a/app/Http/Controllers/PlaylistsController.php b/app/Http/Controllers/PlaylistsController.php index 7b9c6f48..609b378a 100644 --- a/app/Http/Controllers/PlaylistsController.php +++ b/app/Http/Controllers/PlaylistsController.php @@ -63,8 +63,12 @@ class PlaylistsController extends Controller public function getDownload($id, $extension) { $playlist = Playlist::with('tracks', 'user', 'tracks.album')->find($id); - if (!$playlist || !$playlist->is_public) { + if (!$playlist || (!$playlist->is_public && !Auth::check())) { App::abort(404); + } elseif (!$playlist->is_public && Auth::check()) { + if ($playlist->user_id !== Auth::user()->id) { + App::abort(404); + } } $format = null;