Dynamically change the role based on a variable

0
Hi, I have a Role called “Configurator” and other default role as well. If I get the role information from a Query string or in any other form. I have taken this role information into a variable in mendix, I need to check if variable=’Configurator’ then I need to change the current role to ‘Configurator’. How can I achieve this ?
asked
2 answers
1

Hi Mohammed

Just sharing an example.Hope it helps:

Step4:

Step5:

Step7:

 

Step8:

 

Step10:

answered
0

You can change the current role of the logged in user with ‘Retrieve’ object ‘User’ by ‘CurrentUser’ and change its Userrole using activity ‘Change object’ adding to the association Userroles the role ‘Configurator’.

Mind you, the currentUser has to log out and log in again before the role will become active.

answered