I’m trying to develop an app that has a dynamic menu that shows/hides certain menus depending on the role the user has logged in. I need help on how to implement this kind of functionality if this is possible.
Here are few info:
- The menu items (including the route names) are taken from the server after the user logs in.
- All routes are present regardless of the user role, this means, any user can access any route as long as he knows the url of a particular route (even if it is hidden from the menu). How can I protect this route from being accessed?
I really need help with this. Thanks in advance.