Skip to content
New issue

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

hasAnyRole documentation description doesn't seem to work #1199

Open
darrylhein opened this issue Feb 13, 2025 · 0 comments
Open

hasAnyRole documentation description doesn't seem to work #1199

darrylhein opened this issue Feb 13, 2025 · 0 comments

Comments

@darrylhein
Copy link

In the documentation is says @=hasAnyRole accepts a set of string parameters. But when trying with strings, I get the error:

Overblog\\GraphQLBundle\\Security\\BaseSecurity::hasAnyRole(): Argument #1 ($roles) must be of type array, string given, 
called in /app/cache/dev/overblog/graphql-bundle/__definitions__/ExternalMutationType.php on line 44

If I change it to an array, it seems to work:

@=hasAnyRole(["ROLE_ADMIN", "ROLE_BIG_TIME"])

Should the documentation be correct to say it's an array of strings? hasAnyPermission seems to work this way.

# old:
@=hasAnyRole('ROLE_API', 'ROLE_ADMIN')
# new:
@=hasAnyRole(['ROLE_API', 'ROLE_ADMIN'])

Happy to do it, but I wanted to make sure I'm not just misunderstanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant