Hi all,
I have scenario, i have dashboard page (default page) when login as admin dashboard page appear, when login as user, diffrent page show. how i want to make since the already set the default page. on dashboard page, i already uncheck role for user unauthorized page appear.
The issue happens because your Dashboard is set as the default page but is restricted to Admin only, so normal users see the Unauthorized page. Instead, create a common default page (like a redirect page) without any role restriction. In its logic, check the user role—if Admin, navigate to Dashboard; otherwise, navigate to the User page. This way, users are redirected correctly based on their role
It's working now. Thank you
Hey ,
To encounter this problem, you need to check role in onInitialize of your default page. But I know that you are facing problem to checkRole in onInitialize. To resolve this OutSystems has some functions inside Javascript.
In the above I have used Javascript to check the role and based on the role I am redirecting the Logged In User. Inside Javascript I wrote the below
This is how you can do the redirecting based on N number of users. But still there is some scope to optimize this.This solution will work for your case. Let me know if you face any issues.
Thanks,
Sudip
nice solution, i just want to know, why you use javacript instead of if statement?
Hey, I just followed one of the past discussions of our MVPs. You can have look on that.How to redirect to pages based on User roles and also menus | OutSystems