koel/app/Policies/PlaylistPolicy.php
2024-07-06 17:44:40 +02:00

19 lines
346 B
PHP

<?php
namespace App\Policies;
use App\Models\Playlist;
use App\Models\User;
class PlaylistPolicy
{
public function own(User $user, Playlist $playlist): bool
{
return $playlist->user->is($user);
}
public function download(User $user, Playlist $playlist): bool
{
return $this->own($user, $playlist);
}
}