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

Incorrect output with cannot clause #11

Closed
Sieabah opened this issue Dec 16, 2017 · 4 comments
Closed

Incorrect output with cannot clause #11

Sieabah opened this issue Dec 16, 2017 · 4 comments

Comments

@Sieabah
Copy link

Sieabah commented Dec 16, 2017

Just been trying to fit this into my application and found getting cannot rules pretty hard to actually be taken as false. I must be missing something.

var casl = require('casl');

const ability = casl.AbilityBuilder.define((can, cannot) => {
    cannot('join', 'Room');
});

console.log(ability.can('join', 'Room'));

Or linked here on repl.it

Results in true, when I never said it could and explicitly said it couldn't.

@stalniy
Copy link
Owner

stalniy commented Dec 16, 2017

Good catch! This is a bug.

I will try to fix it in few hours. the latest fix time is Monday :)

Thanks!

@stalniy
Copy link
Owner

stalniy commented Dec 18, 2017

Fixed will be published as 1.0.4

@stalniy
Copy link
Owner

stalniy commented Dec 18, 2017

@Sieabah
Copy link
Author

Sieabah commented Dec 20, 2017

Nice, the repl also works now! Thanks for the quick turnaround.

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

No branches or pull requests

2 participants