Task #2270
closed
Add option to ImportRolesFromCSVExecutor to specify column for MemberOf attribute value
Added by Roman Kučera over 4 years ago.
Updated over 4 years ago.
Description
Now if you specify MemberOf attribute if you want to import role with some system and role attribute, this LRT will set name of the role as return value for the attribute.
This behavior is not very useful and universal, because in a lot of cases this value is different from role name in IdM.
Add new parameter into LRT config to specify which column in .csv contains values for this attribute.
- Status changed from New to In Progress
- % Done changed from 0 to 80
I checked the code and tried the feature, it works great.
As for the code, on line 472 there is
long count = roleSystemService.count(roleSystemFilter, null);
the null is not needed there (it shows warning for me).
Please update the documentation: replace the screenshot and maybe add the new column to the detail of the data at the beginning of the tutorial. Also, there is a "warning" in the documentation "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 and description.". Since this feature works in the same way as description, it should be mentioned there.
Otherwise, it's great. Thank you.
- % Done changed from 80 to 90
Thx for review.
I removed the null parameter.
Documentation now contains new screenshot with setting which is up to date. I added new column into example csv and edited the warning box.
- Target version changed from 2.3.0 to 2.4.0
- Blocks Task #2274: Refactor ImportRolesFromCSVExecutor and CSVToIdM added
It looks good. @kucerar could you please refactor
if(hasMemberOf) {
String transformationScript;
if (hasMemberOfValue) {
transformationScript = MessageFormat.format("\"{0}\"", memberOfValues.get(roleName));
} else {
transformationScript = MessageFormat.format("\"{0}\"", roleName);
}
roleSystemAttributeService.addRoleMappingAttribute(system.getId(), role.getId(), memberOfAttribute, transformationScript, OBJECT_CLASSNAME);
this block of code, which is used twice, into one method? Then i will merge it to develop. Thanks
- Assignee changed from Roman Kučera to Peter Štrunc
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
Also available in: Atom
PDF