Change User Role

Hi All,


I want to change the role of user

On change opening popup and selecting role and clicking on Okay

and on save on main screen updating role passing current user but getting error

Can we update role user_role using createorupdateuserrole or do I need to use grantRole for user.

Please suggest

Hi ujwala, 

I am prepared a sample application to manage the user role. See the attached OAP file in the attachment.

RoleManagement.oap

Thank you Pranav.

Hi ujwala,

You need to use the predefined function present within the created role namely the Check, Grant, and revoke function to check assign, and grant a role to a user.

In order to assign a role to a user, you need to use check if the user has the role or not (by using the check function ). If not present then use the user grant function to assign the user that role.

Similarly, if you want to remove the user from a role then check if the role is been assigned to a user or not using the check function. If already assigned then use the revoke function to remove the role. 

Hi ujwala, 

I am prepared a sample application to manage the user role. See the attached OAP file in the attachment.

RoleManagement.oap

Thank you Pranav.

Hi @ujwala,

As per my understanding you want to change user role OR we can say Edit/Update user role. Right?

if I am correct then On the save action you can use ListFilter.

I am sending you screenshot, It is not exactly matching with your functionality but you can take reference from it.



Thanks,

Shriyash

Thank you for the reply.

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