Monday, September 9, 2013

OIM: How to Disable/Enable User Resource Object using API

Here is the sample code to disable the resource objects allocated to a user:
 
 
Long userKey = Long.parseLong(getUserKey(
"y9506a"));
 
userOp = oimClient.getService(tcUserOperationsIntf.class);
 
tcResultSet userObjects = userOp.getObjects(userKey);
 
Long processKey = userObjects.getLongValue(Users-Object Instance For User.Key");
 
 // Disable the Resource Object
 
userOp.disableAppForUser(userKey, processKey);
 
// Enable the Resource Object
 
userOp.enableAppForUser(userKey, processKey);
 
String ostatus = userObjects.getStringValue(
"Objects.Object Status.Status");
 
System.
out.println(ostatus);






 

No comments: