This commit is contained in:
2024-04-21 14:42:52 +02:00
parent 4b69674ede
commit 8a25f53c99
10700 changed files with 55767 additions and 14201 deletions

View File

@ -0,0 +1,43 @@
<?php
namespace App\Policies;
use App\Models\User;
abstract class CheckoutablePermissionsPolicy extends SnipePermissionsPolicy
{
/**
* Determine whether the user can checkout the accessory.
*
* @param \App\User $user
* @return mixed
*/
public function checkout(User $user, $item = null)
{
return $user->hasAccess($this->columnName().'.checkout');
}
/**
* Determine whether the user can checkin the accessory.
*
* @param \App\User $user
* @return mixed
*/
public function checkin(User $user, $item = null)
{
return $user->hasAccess($this->columnName().'.checkin');
}
/**
* Determine whether the user can manage the accessory.
*
* @param \App\User $user
* @return mixed
*/
public function manage(User $user, $item = null)
{
return $user->hasAccess($this->columnName().'.checkin')
|| $user->hasAccess($this->columnName().'.edit')
|| $user->hasAccess($this->columnName().'.checkout');
}
}