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

Support for roles in auto mode #54

Closed
GhostyJade opened this issue Apr 21, 2021 · 6 comments
Closed

Support for roles in auto mode #54

GhostyJade opened this issue Apr 21, 2021 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@GhostyJade
Copy link

I'm trying to integrate casbin.js for a ReactJS app that needs to have roles but it seems that this library can't support roles. (I've tested with permissions and it works)

I've tried using golang (using CasbinJsGetPermissionForUser to retrieve data) and C# (with CasbinJsGetPermissionForUser defined as a custom function) as backend to test if was my implementation issue or not.

I've used the default RBAC model.conf file and both MSSQL database and default csv file for policies

I'm using the latest version of both casbin.js and node-casbin as dependencies.

Now I ask, is this a missing feature or a bug?
Thanks in advance.

@hsluoyz
Copy link
Member

hsluoyz commented Apr 21, 2021

@Zxilly

@hsluoyz hsluoyz self-assigned this Apr 21, 2021
@hsluoyz hsluoyz added the question Further information is requested label Apr 21, 2021
@hsluoyz hsluoyz moved this from jCasbin Easy Tasks to Casbin.js Easy Tasks in Casbin Easy Tasks for Beginners/Student Applicants Apr 21, 2021
@Zxilly
Copy link
Contributor

Zxilly commented Apr 22, 2021

You can directly use node-casbin.

@GhostyJade
Copy link
Author

Where? How?

I mean
I'm making a frontend and using your Authorizer class to manage permissions. If I have to use node-casbin it means that I have to do the "can/cannot" methods by myself, right?

Or is a backend issue? (Even if I've tested with your golang library and it doesn't work)
Or should I have to use Node as my backend?

@Zxilly
Copy link
Contributor

Zxilly commented Apr 22, 2021

@GhostyJade Node-Casbin is also available for frontend project.
As for now, casbin.js is just a wrapper for node-casbin.
You can turn to node-casbin and use enforce() API instead.
It's possible to implement what you asked for. But you may have to wait a while.

@GhostyJade
Copy link
Author

Thanks for the additional information, I'm gonna try it now.

@GhostyJade
Copy link
Author

I've decided for now to integrate casbin using the manual approach, since it works without any issues.
I think that I can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants