Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
tutorial:adm:roles_-_import_data_from_csv [2019/07/09 06:54]
doischert
tutorial:adm:roles_-_import_data_from_csv [2019/07/11 11:54]
doischert
Line 7: Line 7:
 ==== 1b. Prepare CSV file ==== ==== 1b. Prepare CSV file ====
  
-Here is an example of CSV file which can be used for importing (or updating) roles and set their role attributes.+Here is an example of CSV file which can be used for importing (or updating) roles, setting their role attributes, guarantees (by user, or by role) and criticality. To use this CSV file, create a new identity with user name "user_login", and a new role with code "role_code".
  
 <code> <code>
-roles;description;attribute+roles;description;attribute;criticality;guarantee;guarantee role;
 Manager-A;Leader; Manager-A;Leader;
-LAY-SP;Manager;attr1+LAY-SP;Manager;attr1;3;user_login;role_code
 "CORE-CLOSE "CORE-CLOSE
 AB-role";desc;attr1 AB-role";desc;attr1
 </code> </code>
  
-As you can see roles column can contain single or multiple values (separated by a line; the separator can be specified in the settings of the LRT). For multivalued roles, description and attribute from the same row will be added to every role. +As you can see roles column can contain single or multiple values (separated by a line; the separator can be specified in the settings of the LRT). For multivalued roles, values from the same row will be added to every role. The only exception here is role criticality which cannot be multivalued
-CSV file can have optional number of columns, role, description, and attribute columns are specified in setup of LRT.+CSV file can have optional number of columns: column names are specified in setup of LRT. 
 + 
 +The result of this LRT used with this CSV file should: 
 +  * 4 new roles (Manager-ALAY-SP, CORE-CLOSE, AB-role
 +  * Manager-A will only have a description set (Leader) 
 +  * LAY-SP will have a description (Manager)attribute (attr1), criticality (3), guarantee by identity (with user-name "user-login"), and guarantee by role (with role-code "role_code") set. 
 +  * Roles CORE-CLOSE and AB-role will have a description (desc), and attribute (attr1) set.
  
 ==== Create new LongRunningTask ==== ==== Create new LongRunningTask ====
Line 24: Line 30:
 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 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.
  
-{{ :tutorial:adm:03_scheduler.png?direct&600 |}}+{{ :tutorial:adm:03_scheduler.png?direct&1200 |}}
  
 ==== Fill all attributes ==== ==== Fill all attributes ====
Line 33: Line 39:
 - Import csv file - dropzone to select or drop csv file - Import csv file - dropzone to select or drop csv file
 - Column with roles - Name of the column with roles in csv file - Column with roles - Name of the column with roles in csv file
-- Column with description - name of the column with role description, can be also used to update description +- Column with description - name of the column with role description, can be also used to update description (if your CSV file doesn't contain descriptions, i.e., you are not setting description for any of your roles, leave this line empty)  
-- Column with attributes - name of the column with role attributes, can be also used to update attributes+- Column with attributes - name of the column with role attributes, can be also used to update attributes (if your CSV file doesn't contain attributes, i.e., you are not setting attributes for any of your roles, leave this line empty) 
 +- Column with criticality - name of the column with role criticality, can be also used to update criticality (if your CSV file doesn't contain criticality, i.e., you are not setting criticality for any of your roles, leave this line empty); if no criticality is specified, the default is 0 
 +- Column with guarantee - name of the column with role guarantee by identity login, can be also used to update guarantee (if your CSV file doesn't contain guarantees, i.e., you are not setting guarantees for any of your roles, leave this line empty) 
 +- Column with guarantee role - name of the column with role guarantee by role code, can be also used to update role guarantee (if your CSV file doesn't contain role guarantees, i.e., you are not setting role guarantees for any of your roles, leave this line empty)
 - Form definition code - the code for the definition which will contain the added attributes - Form definition code - the code for the definition which will contain the added attributes
 - Column separator - separator of columns in csv file (default ; ) - Column separator - separator of columns in csv file (default ; )
Line 42: Line 51:
 - Can be requested - (Boolean) - Fills can be requested, can be also used to update already imported settings - Can be requested - (Boolean) - Fills can be requested, can be also used to update already imported settings
  
-<note important>If you are updating the roles, make sure to set the same form definition the role already have. Also, each role can only have one definition, so if you by mistake set a different definition in the LRT configuration, you will without any doubt get an error. Generally, DO NOT use this LRT to change the definition of a role. You can only change the definition if the role has no attributes set yet.</note>+<note important>If you are updating the roles, make sure to set the same form definition the role already have (if they have any). Also, each role can only have one definition, so if you by mistake set a different definition in the LRT configuration, you will likely get an error. Generally, DO NOT use this LRT to change the definition of a role. You can only change the definition if the role has no attributes set yet.</note> 
 + 
 +<note>This LRT can be used to update existing values but it **does not** remove old values. The only overwritten value during update is role criticality.</note>
  
 {{ :tutorial:adm:01_conflrt.png?direct&600 |}} {{ :tutorial:adm:01_conflrt.png?direct&600 |}}
Line 57: Line 68:
 At this point, everything should be set up and when the task ends, roles are imported in IdM with their attributes, placed in the catalogue named by the system name. At this point, everything should be set up and when the task ends, roles are imported in IdM with their attributes, placed in the catalogue named by the system name.
  
-{{ :tutorial:adm:04_resultrole.png?direct&600 |}}+{{ :tutorial:adm:04_resultrole.png?direct&1200 |}}
  
 ==== Known issues ==== ==== Known issues ====
  • by apeterova