Saturday, November 28, 2020

BeanShell script to get the Business Roles and IT Roles attached to an Identity

Business Roles are Assigned Roles and IT Roles are Detected Roles. Below is the BeanShell script to get the list of Assigned and Detected Roles:

Identity user = context.getObjectByName(Identity.class,"Richard.Jackson");

System.out.println("\nListing of Assigned Roles");
 Bundles = (List) user.getAssignedRoles();
 if (null != Bundles) {
        for(Bundle role: Bundles) {
            System.out.println("Role Name = " + role.getFullName() + ";  Role Type = " + role.getType());
    }
}

System.out.println("\nListing of Detected Roles");
List Bundles = (List) user.getBundles();
if (null != Bundles) {
        for(Bundle role: Bundles) {
            System.out.println("Role Name = " + role.getFullName() + ";  Role Type = " + role.getType());
    }
}

Comment below if you find this post helpful.

No comments:

Post a Comment

Form AllowedValues rule to filter Identities with Active Regular Active Directory accounts and identity is active and correlated

 The rule type is AllowedValues. import org.apache.log4j.Level ; import org.apache.log4j.Logger ; import sailpoint.object.Filter ; import sa...