<?php
namespace App\Security\Api\Authorization\Voter\MedicalSurveillance;
use App\Security\Api\Authorization\Voter\AbstractCrudValidationVoter;
use App\Security\Api\Authorization\VoterAttribute\MedicalSurveillance\CaseEmployeeVoterAttribute;
use App\Validator\Api\Data\MedicalSurveillance\CaseEmployeeDataValidator;
/**
* Validation voter.
*
* @package API
* @author fmt.hodzic
* @internal
*/
class CaseEmployeeValidationVoter extends AbstractCrudValidationVoter
{
/**
* Constructor.
*
* @param CaseEmployeeDataValidator $validator The standard validator.
*/
public function __construct(CaseEmployeeDataValidator $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 [
CaseEmployeeVoterAttribute::getAttribute(CaseEmployeeVoterAttribute::METHOD_ID_CREATE),
CaseEmployeeVoterAttribute::getAttribute(CaseEmployeeVoterAttribute::METHOD_ID_DELETE),
CaseEmployeeVoterAttribute::getAttribute(CaseEmployeeVoterAttribute::METHOD_ID_LIST),
CaseEmployeeVoterAttribute::getAttribute(CaseEmployeeVoterAttribute::METHOD_ID_READ),
CaseEmployeeVoterAttribute::getAttribute(CaseEmployeeVoterAttribute::METHOD_ID_UPDATE),
CaseEmployeeVoterAttribute::getAttribute(
CaseEmployeeVoterAttribute::METHOD_ID_UPDATE_ACTIVE_STATUS
),
];
}
}