We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The documentation talking about security https://github.com/Youshido/GraphQLBundle#using-security-voter but i get an Access denied 403 every time.
The text was updated successfully, but these errors were encountered:
use Implement like this
class GraphQLVoter extends Voter { /** @var RolesCheckerService */ protected $rolesChecker; public function setRolesChecker(RolesCheckerService $rolesChecker) { $this->rolesChecker = $rolesChecker; } /** * {@inheritdoc} */ protected function supports($attribute, $subject) { return in_array( $attribute, [ SecurityManagerInterface::RESOLVE_FIELD_ATTRIBUTE, SecurityManagerInterface::RESOLVE_ROOT_OPERATION_ATTRIBUTE, ], true ); } /** * {@inheritdoc} * * @param Mutation $subject */ protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { $user = $token->getUser(); if (! $user instanceof UserInfo) { return false; } if (SecurityManagerInterface::RESOLVE_FIELD_ATTRIBUTE === $attribute) { return true; } if (SecurityManagerInterface::RESOLVE_ROOT_OPERATION_ATTRIBUTE === $attribute) { return $this->rolesChecker->hasAccessTo($subject->getName()); } return true; } }
Sorry, something went wrong.
portey
No branches or pull requests
The documentation talking about security https://github.com/Youshido/GraphQLBundle#using-security-voter but i get an Access denied 403 every time.
The text was updated successfully, but these errors were encountered: