8000 "If user has all roles" doc section confusing · Issue #43 · httpoz/roles · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

"If user has all roles" doc section confusing #43

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

Open
mkarnicki opened this issue May 16, 2017 · 2 comments
Open

"If user has all roles" doc section confusing #43

mkarnicki opened this issue May 16, 2017 · 2 comments

Comments

@mkarnicki
Copy link
mkarnicki commented May 16, 2017

Hi. The section of the documentation here says:

if($user->isAll('admin|forum.moderator')){
        // do something
    }

yet, it contains an alternative symbol ( | ). That's actually confusing, as | would then be ignored in this case? Perhaps you could clarify the behavior in the docs. In my mind, this should throw an exception (you're asking for all, yet using incorrect symbol in the list). Cheers.

@mkarnicki
Copy link
Author

It throws \HttpOz\Roles\Exceptions\RoleDeniedException or \HttpOz\Roles\Exceptions\GroupDeniedException exceptions if it goes wrong.

'if it goes wrong' is also not very descriptive. I know I should file a separate bug, but since this affects documentation, I thought I'd leave a comment here. What happens when the user has a role and belongs to a group that doesn't have that role, does the group middleware still fail?

@httpoz
Copy link
Owner
httpoz commented May 17, 2017

Hey @mkarnicki I'll look at this shortly.

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

2 participants
0