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