accessDecisionManager = $accessDecisionManager; } protected function supports($attribute, $subject) { return $subject instanceof AccompanyingPeriodWorkEvaluationDocument && self::SEE === $attribute; } /** * @param string $attribute * @param AccompanyingPeriodWorkEvaluationDocument $subject * * @return bool|void */ protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { switch ($attribute) { case self::SEE: return $this->accessDecisionManager->decide( $token, [AccompanyingPeriodWorkEvaluationVoter::SEE], $subject->getAccompanyingPeriodWorkEvaluation() ); default: throw new UnexpectedValueException("The attribute {$attribute} is not supported"); } } }