This is an old revision of the document!


Attributes of role

Role attributes define what additional information can (must) be filled in the user's assigned role. A typical example can be the IP address of a user's end station, which must be filled in in a role assignment request.

Definitions of which attributes are to be filled for the role are managed on the role detail (role attributes tab). Here, you define not only what attributes to show in the request, but also their default values and validation settings. This definition is part of the role approval (off by default).

First, you need to create main definition of all attributes witch could be used in role sub-definition. Main form definition can be created in Form definitions agenda.

Attribute from the main definition can be used multiple times in multiple roles.
Main definition must be created for type IdmIdentityRole.

Then, you need to create sub-definition of attributes witch should be filled in assigning a role. Sub-definition can be created on the role detail on the Role attributes tab. In sub-definition you can select an attributes only from main definition. So first what you need to do, is select main definition and save it. Then you can create attribute definition for the role.

Attribute definition for the role define:

* Definition of attribute from the main definition. * Overrides the default value. Default value from attribute in main definition will be prefilled (only on frontend). * Overrides the validation settings. Validation settings from attribute in main definition will be prefilled (only on frontend).

Only attributes defined in the sub-definition will be show on role assigning!

For the purpose of provisioning assigned roles, new attributes (User assigned roles and User assigned roles (for this system)) were created, which can be used in system mapping for provisioning identities. Input of the transformation into the system is a list of valid assigned identity roles. This assignment is represented by the AssignedRoleDto object, which mirrors the object IdmIdentityRoleDto and tries to simplify the work with assigned roles in the transform. This simplification is primarily based on the fact that the object contains the entire DTO (role, identityContract, …) instead of the UUID and mainly contains a map of all the attributes of the assigned role (where the key is the attribute code and the value is a list of all attribute values).

Input for transforming into the system (attributeValue) is a list of all valid user roles (list of AssignedRoleDto). This attribute is only for provisioning and for default strategy (SET).
Structure of AssignedRoleDto is here.
Input of transformation for attribute User assigned roles (for this system) will contain only valid assigned user roles assigned this system!

Example script for print assgined roles to the string:

import eu.bcvsolutions.idm.acc.domain.AssignedRoleDto;
import eu.bcvsolutions.idm.core.api.dto.IdmRoleDto;
 
if (attributeValue) {
    String result = "";
    for(AssignedRoleDto dto : attributeValue){
        result = result + "Role: [" + dto.getRole().getCode() + "] Attributes: [" + dto.getAttributes().toString() + "]";
 
    }
    return result;
}
return "";
Output of this script:
Role: [Helpdesk] Attributes: [[:]]
Role: [RoleWithOneAttribute] Attributes: [[IP:[192.168.0.122]]]
Role: [RoleWithTwoAttributes] Attributes: [[Number of fingers:[20], IP:[168.192.0.10]]]

Read more

  • by svandav