Comments (21)
Workaround:
- Install
path
- Add
decs.d.ts
file with this line:declare module "path";
- Link it by adding it to the
tsconfig.json
file on theinclude
prop
Nope, casbin.js@next version does not resolve this without that workaround.
from casbin.js.
from casbin.js.
@fahussain do you use the casbin.js@next? could you provide the model and policy?
from casbin.js.
For my server side I use NestJS and yes casbin is working there. This is my model:
[request_definition]
r = subject, tenant, object, action
[policy_definition]
p = subject, tenant, object, action
[role_definition]
g = _, _, _
g2 = _, _, _
[policy_effect]
e = some(where (p.eft == allow)) && !some(where (p.eft == deny))
[matchers]
m = g(r.subject, p.subject, r.tenant) && g2(r.object, p.object, r.tenant) && r.tenant == p.tenant && r.action == p.action
I am not sure what you mean by casbin.js@next. I was hoping to use casbin.js on the frontdend in Angular to implement the policies. My policies are going to be dynamic and quite large, generated by an application in which admins can add Tenants, Roles, Users, Objects, Actions, Policies etc... On the server I am using TypeOrm adapter to store policies in MySQL.
from casbin.js.
@fahussain plz refer to https://github.com/casbin/casbin.js/tree/v1 to get the infomation about casbin.js@next
. It is a totally refactor version and can work cross platform, like Angular.
I suggest designing your own protocol for exchanging permission data between the front and back ends. The communication protocols pre-built in legacy casbin.js are not reliable.
from casbin.js.
I tried using casbin.js in my Angular project but it seems casbin is dependent on some core node.js modules
In short, casbin.js@next
is cross-platform version of node-casbin
.
from casbin.js.
I have the same issue here. The next
release is not platform indipendent.
from casbin.js.
from casbin.js.
Can't casbin.js@next
solve this?
from casbin.js.
@giovanni-bertoncelli Could you provide a repository for reproduce this issue?
from casbin.js.
Experiencing the same thing. Here's a repo: https://github.com/danverde/CasbinJS-React/tree/broken
I did make sure to install casbinjs@next
. Looks like it ended up installing 1.0.0, rather than 1.0.1 that I got by installing casbin.js
from casbin.js.
from casbin.js.
Thanks @danverde, I know how to resolve it.
from casbin.js.
Because we are incorrect design, this version is confusing, we are decided to improve the node-casbin
repo, the next version casbin has been released, the casbin@beta
can be available on NPM.
but this version number is incorrect, should be 6.0.0-beta.x
, not 5.14.0-beta.x
. This version is working on React, and Ng.
from casbin.js.
@nodece So I need to use version 6.0.0-beta.x
of the node-casbin
repo rather than the casbin.js
repo? or is/will there be a release of casbin.js
built off the correct version of node-casbin
?
from casbin.js.
So I need to use version 6.0.0-beta.x of the node-casbin repo rather than the casbin.js repo?
Yes, you can install this by yarn add casbin@beta
, then select the 5.14.0-beta.3
.
or is/will there be a release of casbin.js build off the correct version of node-casbin?
We don't continue to release the casbin.js to instead of node-casbin.
from casbin.js.
Installing casbin@next
doesn't work:
And node-casbin 5.14.0-beta.3
doesn't work in the browser either
from casbin.js.
I was able to get casbin.js
running by ejecting the react project and then updating the webpack config file to disable source maps for node_modules
and disabling the polyfill for path
.
from casbin.js.
from casbin.js.
Sorry, casbin@beta
is correct.
from casbin.js.
Installing
casbin@next
doesn't work:And
node-casbin 5.14.0-beta.3
doesn't work in the browser either
Could you provide the log that doesn't work in the browser?
from casbin.js.
Related Issues (20)
- TypeError: can't access property "toString", args[2] is undefined HOT 9
- Golang backend ( CasbinJsGetPermissionForUser ) not working with casbin.js ( react ) HOT 5
- Why the dependabot in this repo doesn't follow semantic-pr in title? HOT 5
- Remove browser API (like window object) to support Server-Side Rendering (Node.js) HOT 1
- Fix NPM dependency registry error in CI HOT 5
- A simple and easy to use casbin.js library for Vue based HOT 5
- Documentation on different modes using Authorizer.can() HOT 2
- can() returns an incorrect value HOT 2
- [frontend] casbinjs.Authorizer is not a constructor
- Authorizer is not exported HOT 5
- casbin.js v0.4.1 not working with react-scripts 5 HOT 7
- Module not found: Can't resolve 'fs' HOT 3
- Error in casbin.js advanced usage. HOT 11
- The automated release is failing 🚨 HOT 2
- Error in casbin.js advanced usage - Uncaught (in promise) Error: Enforcer not initialized HOT 9
- Behavior of client side casbin service HOT 5
- casbin-core HOT 1
- CasbinJsGetPermissionForUser API for Laravel HOT 1
- CasbinJsGetPermissionForUser API for JAVA HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from casbin.js.