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

Throw exception if Ability.can is used incorrectly #192

Closed
stalniy opened this issue May 18, 2019 · 2 comments
Closed

Throw exception if Ability.can is used incorrectly #192

stalniy opened this issue May 18, 2019 · 2 comments

Comments

@stalniy
Copy link
Owner

stalniy commented May 18, 2019

There are few pitfalls starters do:

  1. ability.can(“read”, “User”, { role: “admin” }). Throw exception if the last argument is an object
  2. <Can I=“read” a=“user” of={{ role: “admin” }}>test</Can>. Throw exception when multiple subject or action properties are used (valid for React and Vue)
  3. warn in development mode if Ability contains only forbidden rules (should have at least 1 regular rule)
@stalniy
Copy link
Owner Author

stalniy commented May 18, 2019

Meanwhile please read explanations in #59

@stalniy stalniy closed this as completed in 9df032c Jul 1, 2019
@stalniy
Copy link
Owner Author

stalniy commented Jul 1, 2019

released in @casl/[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant