简体   繁体   中英

Manage Roles in React JS application

What kind of libraries are you using for user role management in your React applications? Any kind of directions are welcome. By role managing I am mostly reffering to showing or hiding certain components of the application.

At the simplest level, I would think you would just reflect the user role in your state, and have components render (or not) accordingly.

If you want to completely hide the existence of privileged code from a non-privileged user, you may need to factor common code into a shared library between user and admin apps, or generate two separate bundles, and authenticate access to the bundles.

Either way, the important thing is that you securely authenticate requests that would change server state in privileged ways.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM