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