Skip to content

Commit

Permalink
fix: added attach resources to song policy (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyrch authored Nov 13, 2023
1 parent 683f9ff commit 6aa43bb
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions app/Policies/Wiki/SongPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,37 @@ public function detachArtist(User $user): bool
{
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));
}
}

0 comments on commit 6aa43bb

Please sign in to comment.