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

Panic on non existence permission? #22

Closed
nmsobri opened this issue May 22, 2018 · 0 comments · Fixed by #24
Closed

Panic on non existence permission? #22

nmsobri opened this issue May 22, 2018 · 0 comments · Fixed by #24

Comments

@nmsobri
Copy link

nmsobri commented May 22, 2018

Let say i have this sorts of permissions:

permissions["view_sales"] = gorbac.NewStdPermission("view_sales")
permissions["edit_sales"] = gorbac.NewStdPermission("edit_sales")
if rbac.IsGranted("cashier", permissions["delete_sales"], nil) {
    fmt.Println("Permission delete_sales::YES")
}

gorbac will simply throw a panic on me if delete_sales is not a valid / non existence permission.
Is there a way to simply return false instead?

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 a pull request may close this issue.

1 participant