Which IIQ version are you inquiring about?
8.3sp2
Issue Summary
We are having issues with removing a role from code. We cannot build a ProvisioningPlan that will do the Remove Role function from the GUI in the Manage Access panel.
Can I have some example code of removing a role assignment? Since we haven’t been able to remove the business role, the aggregation and refresh will add everything back.
Possible Solution
I need a method to either make a provisioning plan with the right arguments or some magical identity function that can remove a certain assigned role.
Trouble Code
Here is something that I have tried, but it gave a general error when I added the context.commitTransaction()
// I couldnt find a way to filter by application on the required role so I have to filter on the IT roles
Application app = context.getObjectByName(Application.class, oracleAppName);
List <Bundle> ITRoles = identity.getBundles(app);
List <Bundle> RequestableRoles = identity.getAssignedRoles();
//this was fun to figure out... I have to determine which required role to remove based on the IT required role that is assigned to it
for(Bundle ITrole : ITRoles)
{
String ITroleName = ITrole.getFullName();
for(Bundle RequestableRole : RequestableRoles)
{
String RequestableRoleName = RequestableRole.getFullName();
List <Bundle> RequiredITRoles = RequestableRole.getRequirements();
for(Bundle RequiredITRole : RequiredITRoles)
{
String RequiredITRoleName = RequiredITRole.getFullName();
if(RequiredITRoleName.equals(ITroleName))
{
identity.removeAssignedRole(RequestableRole);
}
}
}
}
context.saveObject(identity);
context.commitTransaction();