cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve list of user mapped to a portal user group

Former Member
0 Kudos

Hi all,

I want to retrieve the list of users mapped to a portal group.

Thanks

Supriya.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

We can use the UME API's to get the desired output.

Do the following -

1)Get the Group by UMFactory.getGroupFactory.getGroupbyUniquename(); This will rteturn the object of IGroup

2)we have a method called getGroupMembers in the IGroup Interface . <IGroupObject>.getGroupMember()

3)The above method will return the iterator and while iterating the iterator object in a loop we can type cast the Object to IUser.

4)From the IUSer interface we can get the Uniquename or display name of the user.

Thanks,

Raju Bonagiri

Former Member
0 Kudos

Thanks

Former Member
0 Kudos

like this:

	public static ArrayList getUserMembersOfGroup(String groupName) throws UMException {
		ArrayList users = new ArrayList();
		
		if (groupName != null) {
			IGroup group = UMFactory.getGroupFactory().getGroup(groupName);
			if (group != null) {
				Iterator iterator = group.getUserMembers(true);
				while(iterator.hasNext()) {
					String uniqueId = (String) iterator.next();
					IUser user = UMFactory.getUserFactory().getUser(uniqueId);
					if (!users.contains(user.getName())) {
						users.add(user.getName());
					}					
				}				
			}			
		}
				
		return users;
	}

Former Member
0 Kudos

HI supriya

Try the following

p330068
Active Contributor
0 Kudos

Hi Supriya

Use UME API for retrieve the list of users associated with portal group.

Hope it helps

Regards

Arun

former_member192152
Active Participant
0 Kudos

Try the methods of these classes:


com.sap.security.api.IUser
WDClientUser.getCurrentUser().getSAPUser()

or


com.sap.security.api.IUserMaint

or these threads:

regards,

Angelo