From edac4e7b9b306a980664a82e3d15aef820fe4dc3 Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Thu, 9 Apr 2026 15:46:42 +0200 Subject: [PATCH] Fix TicketVoter assert to accept Person subject The voter supports Person::class for READ via voterHelper, but the assert in voteOnAttribute() only accepted Ticket|null. This caused assertion failures when rendering person pages that check ticket permissions via menu rendering. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/Bundle/ChillTicketBundle/src/Security/Voter/TicketVoter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillTicketBundle/src/Security/Voter/TicketVoter.php b/src/Bundle/ChillTicketBundle/src/Security/Voter/TicketVoter.php index bf1444385..fa3a7b4d2 100644 --- a/src/Bundle/ChillTicketBundle/src/Security/Voter/TicketVoter.php +++ b/src/Bundle/ChillTicketBundle/src/Security/Voter/TicketVoter.php @@ -50,7 +50,7 @@ final class TicketVoter extends Voter implements ProvideRoleHierarchyInterface protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token): bool { - assert($subject instanceof Ticket || null === $subject); + assert($subject instanceof Ticket || $subject instanceof Person || null === $subject); $user = $token->getUser();