Hi There,



Please suggest on below Requirement: 

I need to automate role assignments when user  logged into application, and based on his role (Role values can be pulled from a physical table) Outsystem role will be auto assigned. Physical table will contain 3-4 pre defined roles & they assigned many employees


E.g. Physical Tbale

Name Role

Smith    Voice Support

John     Manager

Robert   HR

Steve     Voice Support

Outsystems Roles:

1. VoiceSupport

2. Manager

3. HR


1. if Smith role value from a physical table is "Voice Suport" then he should be assigned to outsystems  role "VoiceSupport"

2. if John role value from a physical table is "Manager" then he should be assigned to outsystems  role "Manager"


this should eliminate manual Role assignment at the \users page


Thanks

Phani

Hi Seetharam,

What is your use case here? Do you have some external users and roles that you need to synchronize with OutSystems? Because it seems that you would just need some automatic synchronisation instead of dynamically assign stuff etc.

all users are internal organization employees only.

can you please explain more about automatic synchronization?

Phani M wrote:

all users are internal organization employees only.

can you please explain more about automatic synchronization?

Hi Phani,

I was able to achieve the similar requirement by calling a server action on login server action, username(i.e. employee id) can be passed as input parameter to the server action and that server action will have logic to read the eligible role for the logged in person. According the role can be assigned calling built in roles methods, once a role is assigned you have to logout behind and login in the login server action if you want roles to available in the same session. Otherwise roles will be available when the user logs out and login again.

If you can manage your role assignment to be scheduled basis Then you can create a server action which will assign the roles to employees and that server action can be scheduled by creating a Timer under process tab. You can schedule the Timer as per your requirement.


Thanks,

Zubair


Phani M wrote:

can you please explain more about automatic synchronization?

See e.g. here. I'm not an expert on these matters, however.