Admin Workflow Initial Commit

This commit is contained in:
Dillon Ngo
2024-12-02 23:06:44 +08:00
parent 0824a45b41
commit c1bd61dfc7
54 changed files with 3662 additions and 16 deletions
@@ -0,0 +1,45 @@
<?php
namespace App\Classes\Modules\Questionnaires\Standards\Rules;
use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\ValueObjects\Constants\RoleTypes;
class CanListQuestions extends AbstractRule
{
/**
* @return bool
*/
protected function authorized($object): bool
{
$roleToCheck = Auth()->user()->type;
if (in_array($roleToCheck, RoleTypes::ADMIN_ROLES)) {
return true;
} else {
return false;
}
}
/**
* @param $object
* @return bool
*/
protected function validators($object): bool
{
return true;
}
/**
* @param $object
* @return bool
*/
protected function criteria($object): bool
{
return true;
}
}