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

Permission check with multiple roles changes underlying grants model. #2

Closed
aleclerc opened this issue Mar 7, 2017 · 1 comment
Closed
Labels
bug To be fixed.

Comments

@aleclerc
Copy link

aleclerc commented Mar 7, 2017

The following simple test fails, and actually changes the underlying grant model.

    it('Check with multiple roles changes grant list', function () {
        var ac = new AccessControl(grantList);

        // Admin can update any video
        expect(ac.can(['admin']).updateAny('video').granted).toEqual(true);

        // console.log('grants', ac.getGrants());

        // This check actually changes the underlying grants
        ac.can(['user', 'admin']).updateOwn('video');

        // console.log('grants', ac.getGrants());

        // Admin can update any video (nope not anymore!)
        expect(ac.can(['admin']).updateAny('video').granted).toEqual(true);
    });
@onury onury added the bug To be fixed. label Mar 8, 2017
@onury
Copy link
Owner

onury commented Mar 11, 2017

Thanks for the catch. This is fixed in new release v1.5.0
This release also brings other improvements and TypeScript support.

@onury onury closed this as completed Mar 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug To be fixed.
Projects
None yet
Development

No branches or pull requests

2 participants