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 [2020/06/15 07:15]
doischert
tutorial:adm:roles_-_import_data_from_csv [2020/07/02 11:14]
doischert
Line 3: Line 3:
 ==== 1. Prepare the CSV file ==== ==== 1. Prepare the CSV file ====
  
-Here is an example of a CSV file which can be used for importing (or updating) roles, setting their role attributes, guarantees (by user, or by role) and criticality, for saving them in a created catalogue and for assigning their subordinate role. To use this CSV file, create a new identity with user name <nowiki>"user_login"</nowiki>, and a new role with code <nowiki>"role_code"</nowiki>.+Here is an example of a CSV file which can be used for importing (or updating) roles, setting their role attributes, guarantees (by user, or by role) and criticality, for saving them in a created catalogue and for assigning their subordinate role. To use this CSV file, create a new identity with user name <nowiki>"user_login"</nowiki>, and a new role with code <nowiki>"role_code"</nowiki> to set guarantees.
  
 <code> <code>
-roles;description;attribute;guarantees;guarantee_type;guarantee_role;guarantee_role_type;criticality;catalogue;subroles;memberValue +roles;code;description;attribute;guarantees;guarantee_type;guarantee_role;guarantee_role_type;criticality;catalogue;subroles;eav_info;system_info 
-Manager-A;Leader;;;;;;;;role_code; +Manager-A;Manager-A;Leader;;;;;;;;role_code;attribute:DSF17
-LAY-SP;Manager;attr1;user-login;type1;role_code;type2;3;cat4;;role.one.value+LAY-SP;LAY-SP;Manager;attr1;user-login;type1;role_code;type2;3;cat4;;;virtual:rights:role.one.value
 "CORE-CLOSE "CORE-CLOSE
-AB-role";desc;attr1;;;;;2;"cat1 +AB-role";;desc;attr1;;;;;2;"cat1 
-cat3";;+cat3";;;
 </code> </code>
  
Line 22: Line 22:
 The result of this LRT used with this CSV file should: The result of this LRT used with this CSV file should:
   * 4 new roles <nowiki>(Manager-A, LAY-SP, CORE-CLOSE, AB-role).</nowiki>   * 4 new roles <nowiki>(Manager-A, LAY-SP, CORE-CLOSE, AB-role).</nowiki>
-  * <nowiki>Manager-A will have a description set (Leader) and a subrole set (role_code).</nowiki> +  * <nowiki>Manager-A will have a description set (Leader),a subrole set (role_code), and an EAV attribute "attribute" set with value "DSF17".</nowiki> 
-  * <nowiki>LAY-SP will have a description (Manager), attribute (attr1), criticality (3), guarantee by identity (with user-name "user-login" and type of guarantee "type1"), and guarantee by role (with role-code "role_code" and type of guarantee "type2") set. It will be saved in catalogue cat4.</nowiki>+  * <nowiki>LAY-SP will have a description (Manager), attribute (attr1), criticality (3), guarantee by identity (with user-name "user-login" and type of guarantee "type1"), and guarantee by role (with role-code "role_code" and type of guarantee "type2") set. It will be saved in catalogue cat4. It will create account in system "virtual" and fill the attribute "rights" with value "role.one.value".</nowiki>
   * Roles CORE-CLOSE and AB-role will have a description (desc), an attribute (attr1), and criticality (2) set. They will be in catalogues cat1 and cat3.   * Roles CORE-CLOSE and AB-role will have a description (desc), an attribute (attr1), and criticality (2) set. They will be in catalogues cat1 and cat3.
  
Line 56: Line 56:
 - Column with role 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 role 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)
 - Form definition code - the code for the definition which will contain the added attributes (you only have to fill this if you are setting attributes) - Form definition code - the code for the definition which will contain the added attributes (you only have to fill this if you are setting attributes)
 +
 +**Role EAVs:**
 +
 +- Column with EAV attribute codes and values: name of the column with role EAVs codes and values, separate the code and the values by ':', e. g. "attribute_code:attribute_value". Only attributes from the main role definition can be imported and they must of type SHORTTEXT. Can be multivalued. Supports update (the current value of the attribute will be overwritten if imported). (since Extras 2.5.0)
  
 **Guarantees:** **Guarantees:**
Line 66: Line 70:
 - Update guarantee role types - check if you want to add new guarantee type to an existing guarantee role (this will create a new guarantee with the selected type, the original one will still exist) (since Extras 2.2.0) - Update guarantee role types - check if you want to add new guarantee type to an existing guarantee role (this will create a new guarantee with the selected type, the original one will still exist) (since Extras 2.2.0)
  
-System:+**System:**
  
-System name - name of the system to connect with roles (if you do not want to connect your roles to any system, leave this line empty) +Column with system informations (name of the system, attribute, its value) - name of column with the name of the systemimported attributes and its value is, separate the system name, attribute code and the value by ':', e. g. "AD:ldapGroups:BCV_all". The attribute has to a multivalued attribute with merge strategy set. (since Extras 2.5.0)
-MemberOf attribute name name of multi valued attribute for merge; (if you do not want to do thatleave this line empty) +
-- MemberOf attribute value name - name of column where the value which should be used in memberOf attribute is stored (leave empty and role name will be filled in)+
  
-<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 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. Supports update (the current value of the attribute will be overwritten if imported).</note>
  
 <note>This LRT can be used to update existing values but it **does not** remove old values. The only overwritten values during update are role criticality, description and MemberOf attribute value. They will be changed only if they are not empty in the CSV file</note> <note>This LRT can be used to update existing values but it **does not** remove old values. The only overwritten values during update are role criticality, description and MemberOf attribute value. They will be changed only if they are not empty in the CSV file</note>
  • by apeterova