Hi all,
Today I was surprised to see the functioning of the standard 'go back' button of the 'Invalid Permissions' screen that is created by default.
The 'go back' button sends you back to the previous screen, but the previous screen is the screen that you do not have permissions to, so you get redirected to the 'invalid permissions' screen again.
Some workarounds could be:- Changing the 'go back' button to a 'go back to home screen' that everyone has access to.- Storing the last URL, but this cannot be (easily) done via a client variable as the 'invalid permissions' screen is in a different module than then other screens.
I was wondering what your solutions are to this problem, as I would expect a simple solution must be available for the 'go back' button to work as expected: namely, sending you back to the last screen where you did have the right permissions.
Hello Maud,
I agree with your workarounds with some inputs from my side.
1. Changing the 'go back' button to a 'go back to home screen' that everyone has access to.
Since application users might have different roles, you might add a Go Back button click handler, and inside it based on the user roles redirect them to specific landing screens.
2. Storing the last URL, but this cannot be (easily) done via a client variable as the 'invalid permissions' screen is in a different module than then other screens.
I think it is manageable through a public client action wrapping the client variable. You can take dependency of this client action in any module and set/get the client variable value.
Hope it helps!
Junaid
Good points, thanks for your reply!
Hi @Maud van Paassen ,
There is definitely something weird happening when trying to go back to a previous screen after getting an invalid permissions, or after being redirected to the login screen.
This button with transition (previous screen) does whatever the back button on the browser does (and so is not entirely under your control and/or browser independant). My experience is that the screen for which you don't have permission, doesn't become part of the browser history (my guess : because the redirect to the OnException happens before the screen onReady), and so that is not the one you are sent back to.
But I noticed, that when using the back button between 2 normal successfully loaded screens, it ofte n works as expected, but trying to go back after being redirected to the invalid permissions or the login screen, there is weird behaviour : it is going back to not the previous, but the one before that.
After going to the login screen voluntary, or just typing the invalid permissions url in the browser address, the back button works, so the stuff they did that causes the back button to skip a page, must be somewhere in the exception handling, before coming into the OnException. They must have some code there to somehow erase the middle page from the browser history???
So, agree that the standard 'Go Back' button does not work right, but as to what you want to happen here, could be a question to your business. Do they even want anything there for going back, and if so, back to what ? Maybe whatever the user was doing before trying to access a page without permissions is irrelevant to what they want to do next ??
Dorine
Hi Dorine,
Thank you for your response.
You mention "My experience is that the screen for which you don't have permission, doesn't become part of the browser history (my guess : because the redirect to the OnException happens before the screen onReady), and so that is not the one you are sent back to. ".
This is what I would hope to happen, but this doesn't happen in my application. The screen does become part of the browser history resulting in the 'go back' button to go back to that screen and then be redirected to 'invalid permissions' again.
that's very odd, maybe it is a matter of version of the platform, I'm testing this on my personal environment, version 11.23.0