Current User role is ‘Administer’ ($currentUser) , how can I set this $currentUser to ‘Configurator’
Mohammed Jaffer Ali N
try out this steps in a microflow:
Retrieve the userRole you want to assign from the database (retrieve first object from db with xpath Constraint [Name = 'Configurator']
Then add a change object action in the microflow, select currentUser as object and pick the association ‘System.UserRoles’ as member. Finally add the retrieved Configurator object to the system.UserRoles member and commit.
Be aware that by default the user can be assigned to multiple userRoles. So if the user should only have the Configurator Role, you have to remove the Admin role as well. Another way to manage user roles on the front end is to use the AccountManagement module. Manage Local Users in Studio | Mendix Documentation