mirror of
https://github.com/koel/koel
synced 2024-11-28 15:00:42 +00:00
18 lines
346 B
PHP
18 lines
346 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->id !== $userToDestroy->id;
|
|
}
|
|
}
|