helper = $voterHelperFactory ->generate(self::class) ->addCheckFor(null, [self::COMPOSE_EXPORT, self::GENERATE_SAVED_EXPORT]) ->build(); } protected function supports($attribute, $subject): bool { return $this->helper->supports($attribute, $subject); } protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { return $this->helper->voteOnAttribute($attribute, $subject, $token); } public function getRolesWithHierarchy(): array { return ['export.role.export_role' => [ self::COMPOSE_EXPORT, self::GENERATE_SAVED_EXPORT, ]]; } public function getRoles(): array { return [self::COMPOSE_EXPORT, self::GENERATE_SAVED_EXPORT]; } public function getRolesWithoutScope(): array { return $this->getRoles(); } }