koel/app/Policies/PlaylistPolicy.php

20 lines
346 B
PHP
Raw Normal View History

<?php
namespace App\Policies;
use App\Models\Playlist;
2015-12-15 00:48:48 +00:00
use App\Models\User;
class PlaylistPolicy
{
public function own(User $user, Playlist $playlist): bool
{
2022-07-27 08:49:33 +00:00
return $playlist->user->is($user);
}
2024-01-07 12:43:10 +00:00
public function download(User $user, Playlist $playlist): bool
{
return $this->own($user, $playlist);
}
}