Dear All,
How to get all the groupinfo's associated to a particular user.
Ex:
User : Santosh is associated to Design & Production gruops.
Using API i need to get the groups the user "Santosh" is associated with.
Any example would be helpful.
Thank You in advance
Solved! Go to Solution.
Solved by Redmond.D. Go to Solution.
There is no way for a regular user to get GroupInfo objects - only Administrators can do that.
However, if you are trying to determine if a user is in a specific group, you can do that with the GetGroupByName call in the AdminService. If the user is in the group, it will return a Group object (not a GroupInfo object); otherwise, it will throw a PermissionDenied exception.
-Dave
Thank You for your reply.
i am aware that i have to be logged in as administrator.
I want to know what groups a specific user is associated with.
Currently i am running a loop using individual userid in groups and gettgin the output perfectly.
Is there any other method to accompish the same task..?
Yes, cycling through all the groups and users is really the only way to do it. Keep in mind that groups can have groups, so a user may be "in" a group even if there is no direct link to that group. Effective Permissions has some code related to this issue, so you may want to have a look at the code.
Can you publish the code which scanned all users and their groups?