fix: added attach resources to song policy (#610)

This commit is contained in:
Kyrch
2023-11-13 20:35:34 -03:00
committed by GitHub
parent 683f9ff41b
commit 6aa43bbdf9
+33
View File
@@ -147,4 +147,37 @@ class SongPolicy
{
return $user->can(CrudPermission::UPDATE->format(Song::class));
}
/**
* Determine whether the user can attach any resource to the song.
*
* @param User $user
* @return bool
*/
public function attachAnyExternalResource(User $user): bool
{
return $user->can(CrudPermission::UPDATE->format(Song::class));
}
/**
* Determine whether the user can attach a resource to the song.
*
* @param User $user
* @return bool
*/
public function attachExternalResource(User $user): bool
{
return $user->can(CrudPermission::UPDATE->format(Song::class));
}
/**
* Determine whether the user can detach a resource from the song.
*
* @param User $user
* @return bool
*/
public function detachExternalResource(User $user): bool
{
return $user->can(CrudPermission::UPDATE->format(Song::class));
}
}