Saturday, September 19, 2020

How to fetch users from group or entitlement

private String[] fetchUsersFromGroup(String groupName){

String[] userIds = null;

RoleManager roleMgr = Platform.getService(RoleManager.class);

try{

Role role = roleMgr.getDetails(RoleManagerConstants.ROLE_NAME, groupName, null);

String roleKey = role.getEntityId();

List userList = roleMge.getMembers(roleKey, true);

int userListSize = userList.size();

userIds = new String[userListSize];

for(int i = 0; i < userListSize; i++){

User user = (User) userList.get(i);

String userLogin = user.getLogin();

userIds[i] = userLogin;

}

} catch(Exception e){

System.out.println("Exception is : "+e.getMessage());

}

return userIds;

}


Fetch Members from Workgroup

  import java.util.ArrayList;   import java.util.Iterator;   import java.util.List;   import sailpoint.api.ObjectUtil;   import sailpoint.ob...