I have a settings view, which requires a Service role to access. I have set up the view permissions, and now if I am not logged in when I try to navigate to that view, it appears very briefly, before being replaced by the “Access Denied” graphic. This isn’t ideal from a user experience point of view.
What I’d like, is for perspective to somehow check whether I have permission to load that view, and if not, prompt me to log in first. If my login succeeds, and the logged in user has permission to access that view, perspective navigates there as intended by the user. If the login fails, or the logged in user doesn’t have permission to access that view, we get some sort of notification.
I can cobble something together with multiple layered buttons that are visible or invisible depending on the roles of the currently logged in user and some popups, but I can’t think of any way to automatically redirect to the requested view once the login is successful. At any rate, it seems like the sort of thing that might have a simpler solution.
Are there any existing features that I might be able to use to get partway toward achieving this functionality? Could I run a script that checks the user roles, and calls either a login function or a navigate function based on the result? Can a script be queued up to run after the login function, and/or dependant on the results of that login function? Is this the sort of feature that could be added in future versions?