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