configuration as [$attributes, $subj]) { if (null === $subj) { if (null === $subject && \in_array($attribute, $attributes, true)) { return true; } } elseif ($subject instanceof $subj) { return \in_array($attribute, $attributes, true); } } return false; } public function voteOnAttribute($attribute, $subject, $token): bool { $user = $token->getUser(); if (!$user instanceof User) { return false; } if (null === $subject) { return [] !== $this->authorizationHelper->getReachableCenters($token->getUser(), $attribute, null); } return $this->authorizationHelper->userHasAccess( $user, $subject, $attribute ); } }