-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
<Can> action parameter with empty space does not work #157
Comments
Thanks for applause :) Space are treated specially only in @casl/react and @casl/Vue packages for action prop ( The thing is when you use readable props (e.g., So, in that example Im actually checking whether user is able to |
So, yes. Spaces are not allowed in action name but allowed in subject name. I’ll updste docs thanks! |
Then I'll keep replacing spaces with dashes. Thanks for the info :) Also, before closing this issue, I would like to mention another issue which is also related to docs and relatively more harmless :) On the first paragraph that you've listed down the action and subject aliases for
I also struggled to get my
So I think these possible alias combinations also has to be cleared out in docs. It may be less painful for starters :) |
First and foremost, great job with the library. 👏
In my ability file, I defined an ability like following:
can("create space", "ORGANIZATION")
and surrounded a button with necessary Can component as following:
<Can do="create space" on="ORGANIZATION" ability={ability}>
I expected this to work because in @casl/react readme, I saw "read title" as an example for action. But it did not give me necessary permission and hid the button.
But when I replaced space with dash on both of ability and Can definitions ("create space" -> "create-space"), the button appeared.
Should we provide action parameters ("do" and "I") without spaces? (If so, readme also needs to be updated)
or
Is it not a problem at all and should I seek for another possible error that I've made?
Thanks in advance
The text was updated successfully, but these errors were encountered: