koel/app/Policies/UserPolicy.php
2022-07-27 10:49:33 +02:00

18 lines
342 B
PHP

<?php
namespace App\Policies;
use App\Models\User;
class UserPolicy
{
public function admin(User $currentUser): bool
{
return $currentUser->is_admin;
}
public function destroy(User $currentUser, User $userToDestroy): bool
{
return $currentUser->is_admin && $currentUser->isNot($userToDestroy);
}
}