security = $security; } protected function supports(string $attribute, $subject): bool { if (!$subject instanceof IgnoreOriginInstanceRule) { return false; } if (!\in_array($attribute, [self::EDIT, self::DELETE], true)) { return false; } return true; } protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token): bool { switch ($attribute) { case self::EDIT: case self::DELETE: return $this->security->isGranted('ROLE_SUPER_ADMIN'); } return false; } }