vendor/kobizo/cms-bundle/src/Security/Voter/PageCommentVoter.php line 9

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