EnterpriseManager actions to create role and assign user

EnterpriseManager actions to create role and assign user

  
How do you use the build in enterprise actions in service studio to create a role  and assign a user to a role?

1) Check if role X exist, if it does not exist, create role X
2) Assign permission P1,P2,P3 to role X
3) Assign user Y to role X.
Hi Robert,

To do what you are asking for programmatically you can use:

1) EnterpriseManager.Role_CheckExists() and EnterpriseManager.Role_Create()
2) EnterpriseManager.Role_Update()
3) For now you'll have to create a record in the EnterpriseManager.USER_MASTER_ROLE entity directly, but in the next version of EnterpriseManager there will be an action for it.

Cheers,
Tiago Simões
Hello Tiago

Thanks for the tips.

So I would simply add a Role record to "USER_MASTER_ROLE" is that correct? 
 
There is a "primary" attribute in USER_MASTER_ROLE, this field would set the usermaster role to primary? what purpose/function does this serve in EnterpriseManager? 
 


Hi Robert,

Yes, that is correct, you just need to add a record to that entity.
Don't worry about the primary attribute, you can leave it false. I believe it was used to redirect users to different frontoffice applications based on their primary role (if they would login on the EnterpriseManager login page).

Cheers,
Tiago Simões