owner_id === $user->id; } public function access(User $user, Song $song): bool { return License::isCommunity() || $song->accessibleBy($user); } public function delete(User $user, Song $song): bool { return (License::isPlus() && $song->ownedBy($user)) || $user->is_admin; } public function edit(User $user, Song $song): bool { return (License::isPlus() && $song->accessibleBy($user)) || $user->is_admin; } public function download(User $user, Song $song): bool { return config('koel.download.allow') && $this->access($user, $song); } }