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>
This commit is contained in:
Boris Waaub
2026-04-09 15:46:42 +02:00
parent f421c4b188
commit edac4e7b9b

View File

@@ -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();