Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Vishal Panchal
How to get all users assigned to a usergroup
September 19, 2012 11:35 PM
Answer

Vishal Panchal

Rank: Expert

Posts: 277

Join Date: May 20, 2012

Recent Posts

Hi all,

I am currently working with liferay-tomcat-6.1.2 GA2.
Now I want to retrieve all users those who assigned to a specific usergroup.

Suppose I have one SmapleUserGroup and 5 users are currently assigned to the same usergroup.
so How can I retrieve all 5 users by using usergroup name(SmapleUserGroup ).


Please guide me to achieve this.

Thanks & Regards,
Vishal R. Panchal
Alireza Zare
RE: How to get all users assigned to a usergroup
September 19, 2012 11:50 PM
Answer

Alireza Zare

Rank: Regular Member

Posts: 110

Join Date: September 3, 2010

Recent Posts

List<User> users = UserLocalServiceUtil.getUserGroupUsers(userGroupId);
Vishal Panchal
RE: How to get all users assigned to a usergroup
September 19, 2012 11:52 PM
Answer

Vishal Panchal

Rank: Expert

Posts: 277

Join Date: May 20, 2012

Recent Posts

Thanks for the quick response.

It works..!!

Thank you Ivo Alireza Zare.emoticon
Vishal Panchal
RE: How to get all users assigned to a usergroup
September 19, 2012 11:53 PM
Answer

Vishal Panchal

Rank: Expert

Posts: 277

Join Date: May 20, 2012

Recent Posts

Thanks Ivo Ivanov too.
Mazhar Alam
RE: How to get all users assigned to a usergroup
September 20, 2012 12:01 AM
Answer

Mazhar Alam

Rank: Regular Member

Posts: 188

Join Date: November 25, 2011

Recent Posts

Hi,

You can use UserLocalServiceUtil.getUserGroupUsers(groupId) to get the desired users..Hope this helps..
Mazhar Alam
RE: How to get all users assigned to a usergroup
September 20, 2012 12:03 AM
Answer

Mazhar Alam

Rank: Regular Member

Posts: 188

Join Date: November 25, 2011

Recent Posts

Seems you got a quick reply..:-)
Vishal Panchal
RE: How to get all users assigned to a usergroup
September 20, 2012 12:25 AM
Answer

Vishal Panchal

Rank: Expert

Posts: 277

Join Date: May 20, 2012

Recent Posts

Mazhar Alam:
Seems you got a quick reply..:-)



Hi Mazhar Alam,

Yes I got but even thanks for your valuable reply.emoticon!


Thanks & Regards,
Vishal R. Panchal
Mazhar Alam
RE: How to get all users assigned to a usergroup
September 20, 2012 5:10 AM
Answer

Mazhar Alam

Rank: Regular Member

Posts: 188

Join Date: November 25, 2011

Recent Posts

Welcome..:-)
Alireza Zare
RE: How to get all users assigned to a usergroup
September 20, 2012 12:42 PM
Answer

Alireza Zare

Rank: Regular Member

Posts: 110

Join Date: September 3, 2010

Recent Posts

You are welcome!
Troy Griffitts
RE: How to get all users assigned to a usergroup
July 18, 2013 7:25 AM
Answer

Troy Griffitts

Rank: New Member

Posts: 16

Join Date: August 6, 2011

Recent Posts

Any idea which jsonws call to use?
Suraj Bihari
RE: How to get all users assigned to a usergroup
November 13, 2013 1:55 PM
Answer

Suraj Bihari

Rank: Junior Member

Posts: 42

Join Date: May 20, 2011

Recent Posts

Hi Troy,

Hopefully you already found the answer... here are my two-cents:

There is a complete list available on http://localhost:8080/api/jsonws
In this case is what you are looking for is http://localhost:8080/api/jsonws?signature=%2Fuser%2Fget-user-group-users-1-userGroupId

Enjoy liferay!
Best regards,
Suraj