physiotherapy-clinic/app/Policies/InvoicePolicy.php

34 lines
694 B
PHP

<?php
namespace App\Policies;
use App\Models\User;
class InvoicePolicy
{
public function viewAny(User $user): bool
{
return in_array($user->role, ['admin', 'manager', 'receptionist']);
}
public function view(User $user): bool
{
return in_array($user->role, ['admin', 'manager', 'receptionist']);
}
public function create(User $user): bool
{
return in_array($user->role, ['admin', 'manager', 'receptionist']);
}
public function update(User $user): bool
{
return in_array($user->role, ['admin', 'manager']);
}
public function delete(User $user): bool
{
return $user->role === 'admin';
}
}