Initial commit - Physiotherapy Clinic Management System
This commit is contained in:
commit
dbb326f2cc
300 files changed
+144285
No files matched your search
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class WagePolicy
|
||||
{
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return in_array($user->role, ['admin', 'manager']);
|
||||
}
|
||||
|
||||
public function view(User $user, $wage): bool
|
||||
{
|
||||
if (in_array($user->role, ['admin', 'manager'])) {
|
||||
return true;
|
||||
}
|
||||
// Therapists can only see their own wages
|
||||
return $wage->user_id === $user->id;
|
||||
}
|
||||
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return in_array($user->role, ['admin', 'manager']);
|
||||
}
|
||||
|
||||
public function approve(User $user): bool
|
||||
{
|
||||
return in_array($user->role, ['admin', 'manager']);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user