29 خطوط
508 B
PHP
29 خطوط
508 B
PHP
<?php
|
|
|
|
namespace App\Policies;
|
|
|
|
use App\Models\User;
|
|
|
|
class UserPolicy
|
|
{
|
|
public function view(User $user): bool
|
|
{
|
|
return $user->hasPermission('view_team');
|
|
}
|
|
|
|
public function create(User $user): bool
|
|
{
|
|
return $user->hasPermission('create_team');
|
|
}
|
|
|
|
public function update(User $user): bool
|
|
{
|
|
return $user->hasPermission('edit_team');
|
|
}
|
|
|
|
public function delete(User $user): bool
|
|
{
|
|
return $user->hasPermission('delete_team');
|
|
}
|
|
}
|