security = $security; } protected function supports($attribute, $subject) { return $subject instanceof AccompanyingPeriodWorkEvaluation && self::SEE === $attribute; } /** * @param string $attribute * @param AccompanyingPeriodWorkEvaluation $subject */ protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { switch ($attribute) { case self::SEE: return $this->security->isGranted(AccompanyingPeriodWorkVoter::SEE, $subject->getAccompanyingPeriodWork()); default: throw new UnexpectedValueException("attribute {$attribute} is not supported"); } } }