Handle multiple roles that access the same route
Unanswered
Barbary Lion posted this in #help-forum
Barbary LionOP
I am wondering what is the best approach to use if i have for example a page "/dashboard" but the content of the page will be different for each role "admin" or "employee", is it better to use an condition in the dashboard component to render the component based on the role, or to use different routes for each role like "/dashboard/admin" and "/dashboard/employee" ??
3 Replies
@Barbary Lion I am wondering what is the best approach to use if i have for example a page "/dashboard" but the content of the page will be different for each role "admin" or "employee", is it better to use an condition in the dashboard component to render the component based on the role, or to use different routes for each role like "/dashboard/admin" and "/dashboard/employee" ??
I like to use a condition inside the page, as it's simpler for the user and keep the url clean
@Barbary Lion solved?
Barbary LionOP
yes sir