updating user role

Hello All,

I have table on my screen and on change of record want to update the user role and save on main screen.

When I click on change popup opens ,current record shows where I need to select the role and click okay.On Main screen I have save button.

But above is giving error.

Please suggest how to update the role in user_role for the current selected user.


Reagrds

Sorry, is it giving an error message or a warning message? If warning, looks like its because you are using the update action directly in a client action - the correct would be calling a server action with this logic encapsulated

Hello,

You if you want to give multiple role to a user, instead of using entity action,

Use grant(), revoke() it will work perfectly,

we have created a functionality in our project where if user have already has a role, so we check in a condition which user have currently and by using switch cases we are assigning role to a user by using different roles grant actions.

so try with this - to get roles of the current espace , take a dependency of Roles Entity in your module and apply a filter EspaceId=GetEntryEspaceId(), it will only fetch you the roles of current espace,


hope this is helpful

thanks

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