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

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