Demo App
Medium Article
In the article example is different but the approach is same
The idea is, simply prevent the app to generate unnecessary routes, rather checking current user role on each route it is great to generate only the routes that user have access.
- Generate only the routes that user have access
- The central roles configuration file
- Easy to update roles permission
- Multiple roles support
- Check at once
- Common routes support, etc
- Works with roles hierarchy (But need some changes)
- Design same approach for components