vendor/kobizo/core-bundle/src/Security/Voter/OptionVoter.php line 8

Open in your IDE?
  1. <?php
  2. namespace Kobizo\Bundle\CoreBundle\Security\Voter;
  3. use Kobizo\Component\Entity\Option;
  4. use Kobizo\Component\Resources\AccessControl\OptionResource;
  5. class OptionVoter extends KobizoVoter
  6. {
  7.     protected function supports($attribute$subject): bool
  8.     {
  9.         if (!in_array($attributeOptionResource::getAllResources())) {
  10.             return false;
  11.         }
  12.         if (!$subject instanceof Option
  13.             && !in_array($attribute, [OptionResource::INDEXOptionResource::CREATE])
  14.         ) {
  15.             return false;
  16.         }
  17.         return true;
  18.     }
  19. }