cancel
Showing results for 
Search instead for 
Did you mean: 

How to determine what groups a user belongs to?

Former Member
0 Kudos

The IRoleFactory has this handy method:

public java.lang.String[] getRolesOfUser(java.lang.String uniqueIdOfUser,
                                         boolean recursive)

However, the IGroupFactory has no similar method for fetching all the groups a user belongs to. Is there an easy way to do this?

I suppose I could get all groups, and remove the user from each one, but this isn't very efficient.

Is there a better way?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

In lieu of an answer, I ended up enumerating all the groups, and removing the user from the group if he/she was a member. Not especially efficient, but it works.

FYI, you have to filter out the 'Everyone' and 'Authenticated Users' groups, since you can't remove users from these two groups. If you try, you'll get all sorts of warning and error messages in the logs.