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