src/Security/Voter/Calendar/Pain/Preview/PdfPreviewVoter.php line 12
<?phpdeclare(strict_types=1);namespace App\Security\Voter\Calendar\Pain\Preview;use App\Data\User\PatientUser;use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;use Symfony\Component\Security\Core\Authorization\Voter\Voter;class PdfPreviewVoter extends Voter{protected function supports(string $attribute, mixed $subject): bool{return $subject instanceof PatientUser && $attribute === 'PAIN_CALENDAR_PDF_PREVIEW';}protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool{$user = $token->getUser();if ($user instanceof PatientUser && $subject instanceof PatientUser) {return $user === $subject;}return false;}}