Wrap a front-end library to control permissions for web UI elements like buttons
See original GitHub issueNode-Casbin is only for backend Node.js applications. It can run on frontend but some functionalities like file read/write, DB access will certainly be disabled. So we need a new library for front-end only. It should be:
- Can communicate with backend servers (e.g, via Node-Casbin), sync policies into browser.
- Enforce the policy locally inside a browser.
- Add some friendly functions especially for web, like
isButtonAllowedToBeClicked()
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (8 by maintainers)
Top Results From Across the Web
Managing Access Control in a React App - Level Up Coding
Here the AccessControl component wraps a StatsPanel component. In this particular instance, the user has a permission to read:stats and one of the ......
Read more >How to handle permissions with Styled Components - Medium
I've searched the web for a robust way to handle permissions in the UI level in a React app, but I haven't found...
Read more >UI components | Stripe Documentation
Use Stripe's library of components to quickly build your user interface. If your app needs a frontend, use this reference documentation to compose...
Read more >How to Create and Publish a React Component Library
All code from this tutorial as a complete package is available in this repository. If you are... Tagged with webdev, react, javascript, ...
Read more >Web-based content - Android Developers
If you want to avoid leaving your app to open the browser, or if you want to customize the browser's UI, use Custom...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@hsluoyz I already mentioned this above and let me know how do you want to proceed in this further? I am ready to work upon this.
CASL is similar with Node-Casbin instead of Casbin.js. The core of CASL is to set the access rules and check the permissions. To be specific, Casbin.js should provide some functionalities that the CASL support at some popular frontend library. All the management work is left for the backend server.
For Casbin.js, model configuration is transparent. What Casbin.js concerns about are the actions and the objects. It doesn’t know if the developer are using RBAC or other access-control mechanism. So I believe the core API of Casbin.js should be quite simple as follows.
Some basic API for Casbin.js enforcer are:
This enforcer’s APIs are the cores of Casbin.js. Only after we have finished this part can we going further to design other features serving for manipulating frontend operations (like controling the permissions for web UI elements).