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