mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 04:58:01 +01:00
Fixes #18: Fix downloading of private playlists for playlist owners
This commit is contained in:
parent
967b45c7a7
commit
dc117351ce
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue