105 lines
1.8 KiB
PHP
105 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Policies;
|
|
|
|
use App\Enums\Users\RoleEnum;
|
|
use App\Models\User;
|
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
|
use App\Policies\Rules\UserStaticRules as USR;
|
|
use App\Policies\Rules\UserStaticRules;
|
|
|
|
class ClaimPolicy
|
|
{
|
|
use HandlesAuthorization;
|
|
|
|
/**
|
|
* View a Claim.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function view(): bool
|
|
{
|
|
return USR::everyOne();
|
|
}
|
|
|
|
/**
|
|
* View any a Claim.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function viewAny(): bool
|
|
{
|
|
return USR::everyOne();
|
|
}
|
|
|
|
/**
|
|
* Preview a Claim.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function preview(): bool
|
|
{
|
|
return USR::everyOne();
|
|
}
|
|
|
|
/**
|
|
* Update a Claim.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function update(): bool
|
|
{
|
|
return USR::everyOne();
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can update the associated brand of the model.
|
|
*
|
|
* @param \App\Models\User $authUser
|
|
* @return boolean
|
|
*/
|
|
public function updateBrand(User $authUser): bool
|
|
{
|
|
return UserStaticRules::atLeastRole($authUser, RoleEnum::conceptor);
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can update the associated subject of the model.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function updateSubject(): bool
|
|
{
|
|
return USR::everyOne();
|
|
}
|
|
|
|
/**
|
|
* Update a Claim.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function updateType(): bool
|
|
{
|
|
return USR::everyOne();
|
|
}
|
|
|
|
/**
|
|
* Update a Claim.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function updateStatus(): bool
|
|
{
|
|
return USR::everyOne();
|
|
}
|
|
|
|
/**
|
|
* Update a Claim.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function updateResponseType(): bool
|
|
{
|
|
return USR::everyOne();
|
|
}
|
|
}
|