Skip to content

hasAnyRole documentation description doesn't seem to work #1199

@darrylhein

Description

@darrylhein

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions