How To Assign OutSystems roles automatically

Hi,

We have created custom roles e.g. employee and manager for our application modules which are assigned based on based on employee and supervisor roles in Oracle ERP.

We would like to assign employee/manager roles in outsystems if a new employee is created or if a person becomes supervisor in Oracle ERP.

We could see that GrantEmployeeRole/RevokeEmployeeRole methods which can be invoked from web screen but that would be a manual activity. We want to have a process which will run daily and check the roles against Oracle ERP database and assign/revokes the outsystems roles accordingly.

We tried to explore process option but could not find a way to add GrantEmployeeRole/RevokeEmployeeRole methods inside the process.

Thanks for your help in advance.

Zubair

"We tried to explore process option but could not find a way to add GrantEmployeeRole/RevokeEmployeeRole methods inside the process"

-> To associate a user with a role you can reference the "User_Role" table from system and use the create method from that table (see pic)

Hi Zubair,

You should create a timer that runs everyday and with flpmorais create the needed roles to the users like this

and use one of the CRUD creation actions.

The GrantEmployeeRole is only granted while the sessions lasts or till it gets revoked.

Regards,

Marcelo

Thanks Marco/Flipmorais/Marcelo for your inputs. I am trying the option as suggested by Flipmorais/Marcelo and shall let you know the outcome shortly.

Thanks,

Zubair

Solution

Hi All,

I created a server action to create the role for user using createuser_role method. And then called the action from timer. The roles were successfully assigned.

Thanks for your help.

Zubair

Solution