Conditional home page based on multiple user roles
0
Hi everyone, My app involves conditional home pages that depend on multiple user roles. Essentially, there are two dashboards. Depending on the roles, one of the following three pages should open: Dashboad 1: Account only has a role to access this part of the app. Dashboard 2: Account only has a role to access this part of the app. App Menu: Account has both user roles and should choose to which part of the app to navigate. Right now the ‘app menu’ is the default home page, on which a dataview with a microflow as a source is called. Here the rights are checked. This leads to either a re-direction to dashboard 1 or 2, or remain on the ‘app menu page’. However, the following error occurs in the console of the browser: Ignoring error for page CustomAdministration/ApplicationFunction_Select.page.xml: Loading of a page has been superseded by request for CustomAdministration/Himalaya_Dashboard.page.xml When the page re-directs to one of the dashboards automatically, the progress bar won’t terminate, I believe it has something to with the error above. My question is two-fold: Rather than first loading a page and then (possibly) re-directing, is there a different way to trigger after login? Is there a way to terminate the progress bar ? Note: I could create a third role that combines the access rights of the role for dashboard one a Thanks!
asked
Renze Marree
1 answers
1
Yes, but there is no straightforward way.
option 1: First time the user logs in present her with the choice of which dashboard she want to see. Store her choice in her account-settings, or some userchoice-entity that you create for this purpose. Second time you want to make her go directly to her favorite. I think you even need to create your own handler for that. Not pretty.
option 2: for both pages give the page-property ‘url’ a value. This allows your user to choose which dashboard she wants to go to. Most easy and practical
No, not without losing your session. Only blunt ways: closing your browser or booting your server.