mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
8b01421be7
-Update Non Segment Constant Service Class -Create Non Standard Segment Constant Logic Class -Update Non Standard Segment Constant Logic Class -Delete Non Standard Segment Logic Class
58 lines
1.4 KiB
PHP
58 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\SegmentConstants\Standards\Rules;
|
|
|
|
|
|
use App\Classes\General\Abstracts\AbstractRule;
|
|
use App\Classes\Modules\SegmentConstants\DataTransferObjects\SegmentCompanyObject;
|
|
use App\Classes\Modules\SegmentConstants\Standards\Validators\SegmentConstantValidation;
|
|
|
|
class CanUpdateStandardSegmentConstant extends AbstractRule
|
|
{
|
|
|
|
/** @var SegmentConstantValidation */
|
|
private $segmentConstantValidation;
|
|
|
|
/**
|
|
* CanCreateAddress constructor.
|
|
* @param SegmentConstantValidation $segmentConstantValidation
|
|
*/
|
|
public function __construct(SegmentConstantValidation $segmentConstantValidation)
|
|
{
|
|
$this->segmentConstantValidation = $segmentConstantValidation;
|
|
}
|
|
|
|
/**
|
|
* @return bool
|
|
*/
|
|
protected function authorized(): bool
|
|
{
|
|
// TODO Set Authorization rules
|
|
|
|
if (!\Auth::user()->can('view standard_segment_constant')) {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @param SegmentConstantValidation $object
|
|
* @return bool
|
|
* @throws \App\Classes\Exceptions\RequestValidationException
|
|
*/
|
|
protected function validators($object): bool
|
|
{
|
|
return $this->segmentConstantValidation->validate($object, 'PUT');
|
|
}
|
|
|
|
/**
|
|
* @param SegmentConstantValidation $object
|
|
* @return bool
|
|
*/
|
|
protected function criteria($object): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
} |