koel/app/Policies/UserPolicy.php
2018-08-29 13:15:23 +07:00

13 lines
243 B
PHP

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