70 lines
1.6 KiB
PHP
70 lines
1.6 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Policies;
|
|
|
|
use Illuminate\Foundation\Auth\User as AuthUser;
|
|
use App\Models\Patient;
|
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
|
|
|
class PatientPolicy
|
|
{
|
|
use HandlesAuthorization;
|
|
|
|
public function viewAny(AuthUser $authUser): bool
|
|
{
|
|
return $authUser->can('ViewAny:Patient');
|
|
}
|
|
|
|
public function view(AuthUser $authUser, Patient $patient): bool
|
|
{
|
|
return $authUser->can('View:Patient');
|
|
}
|
|
|
|
public function create(AuthUser $authUser): bool
|
|
{
|
|
return $authUser->can('Create:Patient');
|
|
}
|
|
|
|
public function update(AuthUser $authUser, Patient $patient): bool
|
|
{
|
|
return $authUser->can('Update:Patient');
|
|
}
|
|
|
|
public function delete(AuthUser $authUser, Patient $patient): bool
|
|
{
|
|
return $authUser->can('Delete:Patient');
|
|
}
|
|
|
|
public function restore(AuthUser $authUser, Patient $patient): bool
|
|
{
|
|
return $authUser->can('Restore:Patient');
|
|
}
|
|
|
|
public function forceDelete(AuthUser $authUser, Patient $patient): bool
|
|
{
|
|
return $authUser->can('ForceDelete:Patient');
|
|
}
|
|
|
|
public function forceDeleteAny(AuthUser $authUser): bool
|
|
{
|
|
return $authUser->can('ForceDeleteAny:Patient');
|
|
}
|
|
|
|
public function restoreAny(AuthUser $authUser): bool
|
|
{
|
|
return $authUser->can('RestoreAny:Patient');
|
|
}
|
|
|
|
public function replicate(AuthUser $authUser, Patient $patient): bool
|
|
{
|
|
return $authUser->can('Replicate:Patient');
|
|
}
|
|
|
|
public function reorder(AuthUser $authUser): bool
|
|
{
|
|
return $authUser->can('Reorder:Patient');
|
|
}
|
|
|
|
} |