src/Voters/DisabledUserVoter.php line 14
<?php/** @author Guerby Duval <info@tranzaksyon.com>* @link https://tranzaksyon.com* @copyright You are not allowed to remove this author "Guerby Duval <info@tranzaksyon.com>", the link "https://tranzaksyon.com" neither this copyright.*/namespace App\Voters;use App\Entity\User;use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;use Symfony\Component\Security\Core\Authorization\Voter\Voter;class DisabledUserVoter extends Voter{protected function supports(string $attribute, mixed $subject): bool{return true;}protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool{$user = $token->getUser();if (!$user instanceof User || $user->getDisabledBy() !== null || ($user->getSriInfos()->count() > 0 && $user->getSriInfos()[0]->getDisabledBy() !== null)) {return false;}return true;}}