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

Fix: A parent state's "except" permission that is met will override the child "except" permission that is not met #441

Conversation

nik0kin
Copy link

@nik0kin nik0kin commented Jan 18, 2018

This means a user can access a State he shouldn't have permission to. Vice versa also applies.

I believe this fixes intended functionality (See last paragraph of https://github.com/Narzerus/angular-permission/wiki/Usage-in-ui-router-states#state-permission-inheritance)

See this Codepen showing the bug in action. Clicking "Weasels BB" should redirect to "Weasels AA", because of the except definition, but doesn't. If you comment out the 'weasels' parent state (rootState), then the redirect works.

I added unit tests that fail without my change to "resolveExceptStatePermissionMap()". See the test in StateAuthorization.test.js: "should return rejected promise when a parent state's "except" permissions are met and child state's "except" permissions are not met".

@masterspambot
Copy link
Collaborator

Looks all right now!

@masterspambot masterspambot merged commit 43be752 into RafaelVidaurre:development Jan 20, 2018
RafaelVidaurre pushed a commit that referenced this pull request Aug 31, 2018
…rides

Fix: A parent state's "except" permission that is met will override the child "except" permission that is not met
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

Successfully merging this pull request may close these issues.

2 participants