In the on click event of the go back button on the Invalid permissions page that came with the app I'm building, it is set to (Previous Screen).
After logging into the app, users are directed to a view screen and if they click on a menu item they don't have permission to, the invalid permissions pages is displayed. That is intended behavior, but when I click the Go Back button the user is logged out and returned to the login page even though their previous screen was not that screen.
If I click the view menu item, even though I am already on that screen, and then click on the menu item I don't have permissions to the Previous Screen button works as expected. Returning me to the view screen.
any insight is greatly appreciated.
Hi @Troy Davidson ,
the (Previous Screen) option in Outsystems is nothing other than the browser back button. Test your scenario, and hit the back button on the browser rather than that button, and I think you'll see the same phenomenon.
I'm not sure how you implemented the not being permitted, but if it is on the screen level (check box) then i can reliably reproduce your problem. My best guess is that the bit of inbuilt code that checks the permissions on screen level against the current user, is running very early in the transition, before even flowing to that screen, and redirects to the invalid permissions screen even before that screen is entered into the browser history.
Hitting the browser back button or the (previous screen) flow then brings you one too far back into the history. Is that your scenario, or are you doing something else ? In my opinion, this is a flaw / bug.
To offer an alternative, add some more intelligence to your menu : for each menu item that leads to a screen, make it invisible or disabled if the current user has no permissions on that screen.
Dorine
I ended up just changing the visible property based on user role.
Thank you for the suggestion
glad it helped you.
PS.
(Also referring to your other post about updating trucks), maybe not make a habit of marking your own responses as a solution for your own questions.
I, and probably more people like me, spend our free time on the forum with as sole reward knowing we have been of some help. I personally consider posts marked as solution as confirmation of that.
I meant no disrespect by it, I'm sorry. I changed the solution on both posts to reflect your answer.
Hi Troy Davidson ,
Instead of previous screen as a destination, you can you RedirectToURL like ive used below.
Hope this will help you.
Thanks