mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
50 lines
1.1 KiB
PHP
50 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Companies\Standards\Rules;
|
|
|
|
use App\Classes\General\Abstracts\AbstractRule;
|
|
use App\Classes\Modules\Companies\DataTransferObjects\UserObject;
|
|
use App\Classes\Modules\Companies\Standards\Validators\CompanyValidation;
|
|
|
|
class CanCreateCompany extends AbstractRule
|
|
{
|
|
/** @var CompanyValidation */
|
|
private $companyValidation;
|
|
|
|
/**
|
|
* CanCreateUser constructor.
|
|
* @param CompanyValidation $companyValidation
|
|
*/
|
|
public function __construct(CompanyValidation $companyValidation)
|
|
{
|
|
$this->companyValidation = $companyValidation;
|
|
}
|
|
|
|
/**
|
|
* @return bool
|
|
*/
|
|
protected function authorized(): bool
|
|
{
|
|
// TODO Set Authorization rules
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @param UserObject $object
|
|
* @return bool
|
|
* @throws \App\Classes\Exceptions\RequestValidationException
|
|
*/
|
|
protected function validators($object): bool
|
|
{
|
|
return $this->companyValidation->validate($object);
|
|
}
|
|
|
|
/**
|
|
* @param UserObject $object
|
|
* @return bool
|
|
*/
|
|
protected function criteria($object): bool
|
|
{
|
|
return true;
|
|
}
|
|
} |