Table of Contents

Assign roles to contract EAV - Import of data from CSV

This task assigns roles to contracts. You can either assign roles to every contract of the user, to the main contract, or to a contract specified by contract EAV values.

Prepare CSV file

Here is an example of CSV file which can be used for import role definitions.

login;role;eavname1;eavvalue1;eavname2;eavvalue2
john;role1,role2;eav1;123;eav2;321

As a result, this task will assign roles with the code 'role1' and 'role2' to a user with username 'john' on a contract which has the value of a contract EAV 'eav1' '123' and 'eav2' '321', if such contract exists.

If you want to assign roles to the main contract or to all contracts, you only need to specify the username and the roles.

login;role
john;role1,role2

Create new LongRunningTask

Now we will create the new LongRunningTask(LRT). As shown in the picture, go to Settings → Task scheduler → Scheduled tasks and hit green "Add" button to add new LRT.

Fill all attributes

Now we need to create new LRT with these attributes:

Run the task

Now we just need to hit run.

And we also need to process it in all tasks.

You can check status about created role definitions in "all tasks" panel in task detail. Here you can find information about created or already existing automatic role definitions.

Everything should be set up and when the task ends, roles which was in IdM are assigned to contract with eav value same as in CSV.

Known issues

If you delete or upload new file via dropzone, you should delete old files, created from previous uploads.