Removing Workgroups and Capabilities through a ProvisioningPlan

(Version 8.4)

I’m trying to remove capabilities and workgroups in my leaver using a ProvisioningPlan. I think the code should be something like:

plan.add(“something?”, ProvisioningPlan.Operation.Remove, identity.getWorkgroups());

and something similar for capabilities, but I don’t know and can’t find any example code. Can anyone help?

This is how you can do :

  1. Retrieve the identity’s workgroup list and iterate over each entry, invoking identity. Remove(workgroupName) for each one.
  2. Once all workgroups have been removed, save the identity object and commit the transaction.

Hi @AJGibson76, for “something” you should be able to use “capabilities” and “workgroups”. The value should be a list of the capability or workgroup names.

Oh, and you need to be adding these as AttributeRequest on an AccountRequest for a Modify on the the “IIQ” application.

eg:

AccountRequest request = new AccountRequest(AccountRequest.Operation.Modify, "IIQ", null, identity.getName());
List capabilities = identity.getCapabilities();
if (capabilities != null) {
  List capabilityNames = new ArrayList();
  for (Capability capability : capabilities) {
    capabilityNames.add(capability.getName());
  }
  request.add(new AttributeRequest("capabilities", ProvisioningPlan.Operation.Remove, capabilityNames));
}

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.