<?php
namespace App\Security\Api\Authorization\Voter\Cmr;
use App\Security\Api\Authorization\Voter\AbstractCrudValidationVoter;
use App\Security\Api\Authorization\VoterAttribute\Cmr\CaseEntityVoterAttribute;
use App\Security\Api\Authorization\VoterAttribute\Cmr\EmploymentVoterAttribute;
use App\Validator\Api\Data\Cmr\EmploymentDataValidator;
/**
* Validation voter.
*
* @package API
* @author fmt.hodzic
* @internal
*/
class EmploymentValidationVoter extends AbstractCrudValidationVoter
{
/**
* Constructor.
*
* @param EmploymentDataValidator $validator The standard validator.
*/
public function __construct(EmploymentDataValidator $validator)
{
// prevent false-positive php:S1185
$this->validator = $validator;
parent::__construct($validator);
}
/**
* Returns a list of supported attributes.
*
* @return array
* @noinspection PhpClassConstantAccessedViaChildClassInspection
*/
protected function getSupportedAttributes(): array
{
return [
EmploymentVoterAttribute::getAttribute(EmploymentVoterAttribute::METHOD_ID_CREATE),
EmploymentVoterAttribute::getAttribute(EmploymentVoterAttribute::METHOD_ID_DELETE),
EmploymentVoterAttribute::getAttribute(EmploymentVoterAttribute::METHOD_ID_LIST),
EmploymentVoterAttribute::getAttribute(EmploymentVoterAttribute::METHOD_ID_READ),
EmploymentVoterAttribute::getAttribute(EmploymentVoterAttribute::METHOD_ID_UPDATE),
CaseEntityVoterAttribute::getAttribute(EmploymentVoterAttribute::METHOD_ID_UPDATE_ACTIVE_STATUS),
];
}
}