- package com.oimacademy.role;
- import java.util.HashSet;
- import java.util.List;
- import java.util.Set;
- import oracle.iam.identity.rolemgmt.api.RoleManager;
- import oracle.iam.identity.rolemgmt.vo.Role;
- import com.oimacademy.connection.Platform;
- public class AssignMutipleRolesToUser {
- public static void main(String[] args) throws Exception {
- String ROLE_NAME_PREFIX = "MyRole*";
- RoleManager roleMgr = Platform.getService(RoleManager.class);
- List<Role> roleList = new SearchRole().searchRoleConfigParams(ROLE_NAME_PREFIX);
- Set userKeys = new HashSet();
- userKeys.add("5005");
- for(Role role: roleList){
- roleMgr.grantRole(role.getEntityId(),userKeys);
- System.out.println("Granted role -> "+role.getEntityId()+ " To user -> "+userKeys);
- }
- }
- }
Oracle Identity Manager(OIM) is the Provisioning Solution from oracle. This page contains an index with references to all OIM related posts in the oracle identity manager Academy blog. The posts included herein are intended to provide oracle identity management customers and developers with technical information about best practices for implementing OIM based solutions.
OIM API to Assign Multiple RolesToUser
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment