5.19.4 • Published 1 year ago

@rpmanetworks/casbin v5.19.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

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 with minimatch as a glob pattern matcher for use by globMatch 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.

NOTE

Original Node-Casbin README.md is here