<?php
namespace Kobizo\Bundle\CmsBundle\Security\Voter;
use Kobizo\Component\Entity\PageCommentmeta;
use Kobizo\Component\Resources\AccessControl\PageCommentmetaResource;
use Kobizo\Bundle\CoreBundle\Security\Voter\KobizoVoter;
class PageCommentmetaVoter extends KobizoVoter
{
protected function supports($attribute, $subject): bool
{
if (!in_array($attribute, PageCommentmetaResource::getAllResources())) {
return false;
}
if (!$subject instanceof PageCommentmeta
&& !in_array($attribute, [PageCommentmetaResource::INDEX, PageCommentmetaResource::CREATE])
) {
return false;
}
return true;
}
}