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

Query rule for mentioned permissions #764

Merged
merged 2 commits into from
Jun 9, 2016

Conversation

kevsmith
Copy link
Member

@kevsmith kevsmith commented Jun 9, 2016

This commit uses the newly proposed Permissions.Ast.Rule.permissions_used/1 function to obtain the list of permissions mentioned in a access rule to generate a better access denied error message. This also prevents Cog from crashing when rules mention more than one permission.

This isn't an ideal solution as we're not telling the user exactly which specific permissions they're lacking but it is a step in the right direction and vastly better than crashing.

50% fix for #758

Kevin Smith added 2 commits June 9, 2016 15:39
This commit uses the newly added Permissions.Ast.Rule.permissions_used/1
function to obtain the list of permissions mentioned in a access
rule to generate a better access denied error message. This also
prevents Cog from crashing when rules mention more than one permission.

This isn't an ideal solution as we're not telling the user exactly which
specific permissions they're lacking but it is a step in the right
direction and vastly better than crashing.

50% fix for #758
@kevsmith kevsmith added the review label Jun 9, 2016
@vanstee
Copy link
Member

vanstee commented Jun 9, 2016

LGTM 👍

@kevsmith kevsmith merged commit 9e07d95 into master Jun 9, 2016
@kevsmith kevsmith deleted the kevsmith/multiple-perms-err-msg branch June 9, 2016 20:25
@kevsmith kevsmith removed the review label Jun 9, 2016
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