src/Security/Api/Authorization/Voter/MedicalSurveillance/CaseEmployeeValidationVoter.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Security\Api\Authorization\Voter\MedicalSurveillance;
  3. use App\Security\Api\Authorization\Voter\AbstractCrudValidationVoter;
  4. use App\Security\Api\Authorization\VoterAttribute\MedicalSurveillance\CaseEmployeeVoterAttribute;
  5. use App\Validator\Api\Data\MedicalSurveillance\CaseEmployeeDataValidator;
  6. /**
  7.  * Validation voter.
  8.  *
  9.  * @package API
  10.  * @author fmt.hodzic
  11.  * @internal
  12.  */
  13. class CaseEmployeeValidationVoter extends AbstractCrudValidationVoter
  14. {
  15.     /**
  16.      * Constructor.
  17.      *
  18.      * @param CaseEmployeeDataValidator $validator The standard validator.
  19.      */
  20.     public function __construct(CaseEmployeeDataValidator $validator)
  21.     {
  22.         // prevent false-positive php:S1185
  23.         $this->validator $validator;
  24.         parent::__construct($validator);
  25.     }
  26.     /**
  27.      * Returns a list of supported attributes.
  28.      *
  29.      * @return array
  30.      * @noinspection PhpClassConstantAccessedViaChildClassInspection
  31.      */
  32.     protected function getSupportedAttributes(): array
  33.     {
  34.         return [
  35.             CaseEmployeeVoterAttribute::getAttribute(CaseEmployeeVoterAttribute::METHOD_ID_CREATE),
  36.             CaseEmployeeVoterAttribute::getAttribute(CaseEmployeeVoterAttribute::METHOD_ID_DELETE),
  37.             CaseEmployeeVoterAttribute::getAttribute(CaseEmployeeVoterAttribute::METHOD_ID_LIST),
  38.             CaseEmployeeVoterAttribute::getAttribute(CaseEmployeeVoterAttribute::METHOD_ID_READ),
  39.             CaseEmployeeVoterAttribute::getAttribute(CaseEmployeeVoterAttribute::METHOD_ID_UPDATE),
  40.             CaseEmployeeVoterAttribute::getAttribute(
  41.                 CaseEmployeeVoterAttribute::METHOD_ID_UPDATE_ACTIVE_STATUS
  42.             ),
  43.         ];
  44.     }
  45. }