OIM API To Revoke Grants From Role


  1. package com.oimacademy.NeedEvaluate;
  2. import java.util.HashSet;
  3. import java.util.Set;
  4. import com.oimacademy.connection.Platform;
  5. import oracle.iam.identity.rolemgmt.api.RoleManager;
  6. public class RevokeRoleGrant {
  7.  public static void revokeRoleGrant() {
  8.   RoleManager rolemanagersvc = Platform.getService(RoleManager.class);
  9.   String roleKey = "27"; // role key of the role to be removed testrole
  10.   String usrKey = "2010"; // usr key of the user from which the role must     
  11.   Set<String> usrKeys = new HashSet<String>();
  12.   usrKeys.add(usrKey);
  13.   try {
  14.    rolemanagersvc.revokeRoleGrant(roleKey, usrKeys);
  15.   } catch (Exception e) {
  16.    e.printStackTrace();
  17.   }
  18.  }
  19.  public static void main(String args[]) {
  20.   revokeRoleGrant();
  21.  }
  22. }

No comments:

Post a Comment