This is an old revision of the document!


Assign roles to contract EAV - Import of data from CSV

This task assigns roles to contracts via selected EAV for main contract definition.

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

Username;Role;Position
kopr;Back Office,Front Office;Business
svanda;Manager;Trip Advisor

CSV file can have optional number of columns, role and username columns are mandatory. Choose assigning roles to all contracts, main contract or to EAV contract value. If you choose assign contract to EAV attribute, then column with EAV is mandatory.

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.

Now we need to create new LRT with these attributes:

- Task type - ImportCSVUserContractRolesTaskExecutor - Import csv file - dropzone to select or drop csv file - Column with roles - Name of the column with roles in csv file. - Column with username - name of the column with username - Roles assignment contract type - Asign roles to one of the options:

  • allContracts - assigns roles to all valid and future contracts
  • primeContract - assigns roles to prime/main contract
  • eavContract - assigns roles to contract with specified EAV

- Column with contract eav - Name of the column with contract eav in csv file. Mandatory if you choose assign to eavContract. - Contract eav name - Name of the contract eav in IdM. Mandatory if you choose assign to eavContract. - Column separator - separator of columns in csv file - Multi value separator - separator of roles column in csv file. This works ONLY for roles column. You also need to tick the chechbox - File encoding type - insert encoding of your csv file. Default value is UTF-8 - Contract definition - specify IdmIdentityContract definition. Use it optionally when you choose assign to eavContract. Default value is default.

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 so far and when the task ends, roles which was in IdM are assigned to contract with eav value same as in CSV.

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

  • by kubicar