Adding and Removing User Roles

Good Day

I am trying to create a delegation function for my system where if a supervisor isn’t available, he/she can delegate it to somebody else to do the task. I want that when a delegation is created the person being delegated to has the acting supervisor user role added to their current list of user roles and then having it then removed/revoked when the delegation isn’t active anymore. I want to do it in method in a service the called it in a controller in the editor. can you please assist me.

Thank you in advance.

Kind Regards,
Phileo

Hi @phileo.kazavanga,

Have you considered using User Substitution?

In case the default administrative screen doesn’t fit your requirements, maybe you can just create a custom screen and reuse the standard Cuba-Platform business rules/services.

Regards,
Peterson.