src/Security/Api/Authorization/Voter/CoreModule/HealthInsuranceProviderValidationVoter.php line 15

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