help.axcms.netAxinom Logo
Save Save Chapter Send Feedback
KB10046: How to get all users for a user group
Getting users of a group or groups for an user is done in similar way – through using AxUserAuthorizationAdapter class

SYMPTOMS

You want to get all users from a group or groups for an user.

SOLUTION

Getting users of a group or groups for an user is done in similar way – through AxUserAuthorizationAdapter.LoadUserMembership(int userId, byte UserType) method. Depending on passed UserType argument, the method will retrieve either list of id’s of groups of user, or list of id's of users in a group.      

// getting groups for a user
int[]  groupsIDList = (new
AxUserAuthorizationAdapter()).LoadUserMembership(userID, (byte) UserType.Group);

// getting users of a group
int[] usersIDList = (new
AxUserAuthorizationAdapter()).LoadUserMembership(groupID, (byte)
UserType.SingleUser);


Same technique applies in MS and LS.

MORE INFORMATION: