-
-
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
Cant integrate casl/vue with rails cancancan #214
Comments
You do everything correctly :) and casl works as expected. When you do When you check instances ( |
I appreciate your fast response! Right now, data() {
return {
task: {}
}
} And I have an endpoint on So in order for this to work, I have to:
Is that correct? |
Not exactly. Please find info about Also you can check this repo for a reference |
Close as there is nothing to do from CASL side. Thanks for the interest in CASL! |
Thanks @stalniy! I created a class for |
Right, the sample needs to be updated. All examples, I slowly move into monorepo https://github.com/stalniy/casl-examples . The next one is for There is no need to change |
@stalniy , the link redirected me to intro of the new documentation site. So I assumed (blindly) I need to change (and I had the working component for the wrong reason) and I posted it here (and the other link). I think the one you want to redirect is conditions https://stalniy.github.io/casl/v4/en/guide/subject-type-detection |
Hi,
I am having issues when my rule has a condition. The
$can
method always returns true.The only rules I am trying to add are:
I am using cancancan + @casl/vue. So what I am doing is fetching the cancancan abilities and updating the
$ability
with the response, as per below:I console logged the
$ability
afterwards and it seems to be receiving the rules correctly.I tested with 2 tasks, the first one has
user_id: 1
and the second one hasuser_id: 6
.But when I am logged in as
user_id: 1
the following code, always return true, for any tasks.I have read all the docs more than once, but I can't seem to make it work. I am using all the latest versions of @casl/vue and @casl/ability.
Could you please let me know what I am doing wrong?
Thanks in advance!
The text was updated successfully, but these errors were encountered: