Microflow to change user role.

0
Hi all, I want to let users upgrade to another type of account with more permissions through a button + microflow. To achieve this i need a microflow where i retrieve the registration form that the user filled in to registrate an account, and then change the attribute values of that form. Below you can see what i have for now.  
asked
2 answers
3

Hi Ahmed,

because you asked my directly, this microflow should contain all the information you need. It retrieves the user role you want to add to the user, adds it to the associated userrole list and commits the user.

https://modelshare.mendix.com/models/1ccb5498-2938-4a6d-a1b8-a715aa1719e8/add-userrole-to-current-user

Have fun

answered
2

Hi Ahmed,

You can do this in a microflow by retrieving the current user account and then retrieving the user role you want to give that account. Then you can use the change activity for the account object and pick the user role association. If you want the new user role to replace the exisitng user role, in the change activity of the association, make sure its set to “set”. If you want to add the new user role and keep the existing role, use “add”. Once this is done the new user role won’t take effect until the user logs out and back in again.

 

Hope this helps!

answered