Custom login and role mapping pages mapping

-1
Hello,  I have created a custom “User” table and have role as Admin and Client in the table. I am able to login. But I want to display the home page and menu based on my custom role.  Please advise how this can be done ? 
asked
3 answers
2

Goto navigation and Edit the role based homepages

Regards,

Ronald

 

answered
0

Abhishek,

Is there a reason you are following a completely different approach for navigation and security and not following Mendix’s standard approach? In any case, if you would like to do what you have mentioned, one solution, which may not be the most ideal and elegant is as follows:

  1. On your default home page, you would need to have a button “Click to Proceed”
  2. In the action on this button, you would need to call a microflow and in that microflow, you can retrieve the value of UserRole from your User table
  3. Based on this value, you can have two branches, one to show the page for the “Admin” and other to show for the “Client”
  4. You might have to call that microflow from the home page “Home” item also from the default menu.

 

Once again, I would strongly recommend for you to understand the Mendix’s standard approach and within that see how you can accomplish your requirements rather than following this completely different approach. You might get past the first stage, but, would add to many layers in your App, which might be counter productive.

answered
0

Hi Abhishek,

Mendix will not show the navigations for which user role does not have permission. So assign proper roles under yourmodule->security->page access. So you no need to worry about showing proper navigation menu if you have set up page access properly. (in below screenshot the director_overview page is accessed by the roles admin and directory which is configured under module security. So this navigation will not visible for Coach and participant)

For role specific home page under navigation menu you can call microflow “System.ShowHomePage” which will take care of showing role specific homepage on click of home button under navigation menu.

screenshot url: https://forum.mendix.com/file?guid=19703248369781501

Regards,
Goutam

answered