Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tutorial:adm:assign_roles_to_contract_-_import_of_data_from_csv [2019/06/12 14:15] – hanakp | tutorial:adm:assign_roles_to_contract_-_import_of_data_from_csv [2025/03/13 13:48] (current) – [Fill all attributes] kiml | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Assign roles to contract EAV - Import of data from CSV ====== | ====== 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 ==== | ==== Prepare CSV file ==== | ||
Line 6: | Line 8: | ||
< | < | ||
- | Username;Role;Position | + | login;role;eavname1; |
- | kopr;Back Office;Business | + | john;role1,role2;eav1; |
- | svanda;Manager;Trip Advisor | + | |
+ | </ | ||
+ | |||
+ | As a result, this task will assign roles with the code ' | ||
+ | |||
+ | 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, | ||
</ | </ | ||
- | CSV file can have optional number of columns, role and automatic role definitions columns are specified in setup of LRT. | ||
- | If you want to assign role to all user contracts, let the contract eav value in csv empty. | ||
==== Create new LongRunningTask ==== | ==== Create new LongRunningTask ==== | ||
Line 21: | Line 31: | ||
Now we need to create new LRT with these attributes: | Now we need to create new LRT with these attributes: | ||
- | - Task type - **ImportCSVUserContractRolesTask** | + | * Task type - **Import assigned roles** |
- | - Import | + | * Column separator |
- | - Column with username - name of the column with username | + | * File encoding type - insert encoding of your csv file. Default value is UTF-8 |
- | - Column with roles - Name of the column with roles in csv file | + | * Upload CSV file - dropzone to select or drop csv file |
- | - Column | + | * Column with roles - Name of the column with roles in csv file. |
- | - Contract | + | * **5.3.5+ **Column with role to remove - name of the column, that defines role to remove |
- | - Column | + | * 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 | ||
+ | * Prefix of column | ||
+ | * Prefix of column with contract eav code in the csv file. You can use any number of EAV attributes you choose, only make sure to add numbers after the prefix starting with 1. Mandatory if you choose assign to eavContract. (See the first example of a CSV file above.) | ||
+ | * Prefix of column name with contract | ||
+ | * Prefix | ||
+ | * Multi value separator | ||
+ | * Contract | ||
+ | * Prefix | ||
+ | * Prefix of column with the value of the role parameter (optional) | ||
+ | * Column with role valid from (optional) | ||
+ | * Column | ||
+ | * Role validity format - default " | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | {{.: | ||
- | {{: | ||
==== Run the task ==== | ==== Run the task ==== | ||
Line 35: | Line 65: | ||
Now we just need to hit run. | Now we just need to hit run. | ||
- | {{: | + | {{.: |
And we also need to process it in all tasks. | 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. | 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. | + | 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. |
+ | |||
+ | ==== Role exchange behavior (in extras 5.3.5+) ==== | ||
+ | |||
+ | You can use the LRT to exchange roles (generate a single request to change roles, which removes a role and adds another in the same step). This is useful to for instance exchange a license role for another, without the identity losing access to the licensed software. | ||
+ | |||
+ | To use this behavior, you simply define the **" | ||
+ | |||
+ | To explain the exchange behavior, let's use an example. Let's say you are removing role " | ||
+ | |||
+ | * Identity1 has role role_old_license → it will get replaced by " | ||
+ | * Identity2 does **not **have role_old_license → Nothing will happen, Identity2 will not gain the " | ||
+ | |||
+ | Moreover | ||
+ | |||
+ | * Identity3 already has role_new_license → Nothing will happen, Identity3 will not lose the " | ||
+ | * Identity4 does not have role_new_license, | ||
+ | * Identity5 has multiple assignments of role_old_license → Nothing will happen, it is not clear what assignment should be removed, so no removal is done and therefore no assignment is done too | ||
==== Known issues ==== | ==== Known issues ==== | ||
If you delete or upload new file via dropzone, you should delete old files, created from previous uploads. | If you delete or upload new file via dropzone, you should delete old files, created from previous uploads. | ||
+ | |||