@rpmanetworks/casbin
v5.19.4
Published
An authorization library that supports access control models like ACL, RBAC, ABAC in Node.JS
Downloads
0
Readme
Node-Casbin
Modified version of node-casbin
version 5.19.3
to be used in a webpack 5 project and run in browser.
Tested using NodeJS 16
Changes:
- replaced
picomatch
withminimatch
as a glob pattern matcher for use byglobMatch
in your Casbin model.
Known limitations:
The following tests are failing:
expect(util.globMatch('/foo', '*/foo')).toEqual(true);
expect(util.globMatch('/foo', '*/foo*')).toEqual(true);
expect(util.globMatch('/foo', '*/foo/*')).toEqual(false);
expect(util.globMatch('/foo/bar', '*/foo')).toEqual(false);
expect(util.globMatch('/foo/bar', '*/foo*')).toEqual(false);
expect(util.globMatch('/foo/bar', '*/foo/*')).toEqual(true);
expect(util.globMatch('/foobar', '*/foo')).toEqual(false);
expect(util.globMatch('/foobar', '*/foo*')).toEqual(true);
and have been commented. picomatch
with minimatch
are not 100% compatible, each one has its features over the other, please search the internet for comparisons. Please check https://github.com/isaacs/minimatch
for minimatch
documentation.