I would like to know if we can restrict provisioning on a direct source as follows:
Provision specific groups to all profiles.
Create and sync attributes only for a specific identity profile.
I started to test the following beforeProvisioningRule to remove the request if the identityAttribute doesn’t equal “ResGroup”. However, this doesn’t work.
import sailpoint.object.*;
import sailpoint.object.ProvisioningPlan.AccountRequest;
import sailpoint.object.ProvisioningPlan.AccountRequest.Operation;
import sailpoint.object.ProvisioningPlan.AttributeRequest;
import sailpoint.object.ProvisioningPlan;
import sailpoint.object.ProvisioningPlan.Operation;
List accountRequests = plan.getAccountRequests();
if (accountRequests.isEmpty() ){
throw new Exception("Account Request empty");
}
Identity identity = plan.getIdentity();
String identityAttribute= identity.getAttribute("identityAttribute");
String TYPE_USER = "ResGroup";
if (accountRequests != null) {
if (!identityAttribute.equals(TYPE_USER)){
for (AccountRequest accountRequest : accountRequests) {
accountRequest.remove(new AttributeRequest());
}
}
}
Any mistake i nthe rule ? Can this be achieved with a rule?