How to Create and Assign roles from UI

Hi Everyone

How to Create and Assign role to users directly from UI without assigning from  UserManagement.

Thanks and Regards

Soumya 

Solution

Hi Soumya Mukhopadhyay,

I think you should use GrantRole to assign the role dynamically. 

I also try to use system entities Role to create the new roles and then use User_Role entity action to assign them to the user. You can see the attached OML for reference but I do not see any success.

Thanks
Pankaj

SampleROlesCreation.oml

As far as I know, you cannot create roles dynamically using the Role system entity. The entity and actions to do so are available, but it won't work properly.

However, granting/revoking roles via the User_Role entity is definitely possible. I've done it many times.

Hi Soumya,

when you create a new role you have available a list of actions for that role:

You can use them to grant and revoke roles in runtime.

Regards

Hello,

Additionally to what José posted, you can also manipulate the System entity User_Role to grant/revoke roles:

Solution

Hi Soumya Mukhopadhyay,

I think you should use GrantRole to assign the role dynamically. 

I also try to use system entities Role to create the new roles and then use User_Role entity action to assign them to the user. You can see the attached OML for reference but I do not see any success.

Thanks
Pankaj

SampleROlesCreation.oml

As far as I know, you cannot create roles dynamically using the Role system entity. The entity and actions to do so are available, but it won't work properly.

However, granting/revoking roles via the User_Role entity is definitely possible. I've done it many times.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.