Saturday, May 1, 2021

How to remove Workgroups for the user?

import java.util.ArrayList;

import java.util.List;

import sailpoint.object.Identity;

import sailpoint.api.SailPointContext; 

import sailpoint.tools.GeneralException;


public void removeWorkGroupsAssignment(String name) throws GeneralException{

String methodName = "removeWprkGroupAssignment";

log.debug("Entering into the method : "+methodName);


Identity identityObj = context.getObject(Identity.class, name);

List<Identity idWorkGroups = new ArrayList<Identity>();

idWorkGroups = identityObj.getWorkgroups();


for(Identity workGoup : idWorkGroups){

identityObj.remove(workGoup);

context.saveObject(identityObj);

context.commitTansaction();

}

log.debug("Exiting from the method : "+methodName);

}

No comments:

Post a Comment

ISC Postman Set up

 High-Level Steps:- # Download and install the postman. # Navigate to the home icon and click on a Workspace. # Click on a create  Workspace...