Navigate a user to a specific page on startup

We are developing a project, where we have different users that can login to our server, depending on who they are they should be directed to their respective homepage.

This it’s that bad to do when perspective is opened, then they will be directed to the initial homepage “/”, after the first login. I then have a view that is empty on the initial homepage, where I have a startup event to read what type of user has logged in and then direct them to a specific page.

But my problem is if I where to logout of a user that have access to more pages and then i login as a different user who has a limited access, then the new user will be directed to a page that they dont have access to, I do have permissions setup for all pages so this user can see a view where it says, you dont have permission to view this page, but instead of them seeing this message they should be directed to their homepage.

I have tried to do this in session startup event, it fires when a user login happens and I can write information from the session properties about their ID, username, name and so on, but if i try to navigate them to a page it gives me an error, about “No perspective page attached to this thread”.
Which means the pages hasn’t been “generated” yet.

Thanks in advance :wink:

The most reliable way to mimic a "page startup" event is to use a shared docked view.

  • Implement an onStartup event for the docked view to check for desired behavior on initial page startup. The page will exist for this event, and will only occur once as long as your page configurations do not override the shared dock. Make sure the docked view does not have any security, so it works even when not authenticated (like after logout).

  • Bind authentication information from the session and various page props to custom properties of the docked view. Add Change Scripts to these properties to capture login and logout events and any nav events that need special tracking.

{ The docked view that handles all of this is also a convenient place to put the project's navigation buttons/menus. }