1 Reply Latest reply: Feb 16, 2013 10:17 AM by user9212679 RSS

    OIM11GR2  sample code to publish roles to an organization

    991449
      I am writing a code to create and update roles in OIM. I am not able to find way to implement the role organization mapping. can anybody tell me which class or interface or any specific method can help me ??
        • 1. Re: OIM11GR2  sample code to publish roles to an organization
          user9212679
          you can create the role by using the following code :

          tcGroupOperationsIntf groupManager = getService(tcGroupOperationsIntf.class);
          Map attributes = new HashMap();
          attributes.put("Groups.Group Name", "Role Name");
          attributes.put("Groups.Role Description", "Just for testing");
          long groupKey = groupManager.createGroup(attributes);
          System.out.println("Group key: " + groupKey);

          and below code to modify the role :

          RoleManager service = getService(RoleManager.class);
          Role role = new Role("24");
          role.setAttribute("Role Owner Key", 1L);
          RoleManagerResult result = service.modify(role);

          HTH