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

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