Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Vishal Panchal
How to get all users assigned to a usergroup
19 de Setembro de 2012 23:35
Resposta

Vishal Panchal

Ranking: Expert

Mensagens: 287

Data de entrada: 20 de Maio de 2012

Mensagens recentes

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
19 de Setembro de 2012 23:50
Resposta

Alireza Zare

Ranking: Regular Member

Mensagens: 110

Data de entrada: 3 de Setembro de 2010

Mensagens recentes

List<User> users = UserLocalServiceUtil.getUserGroupUsers(userGroupId);
Vishal Panchal
RE: How to get all users assigned to a usergroup
19 de Setembro de 2012 23:52
Resposta

Vishal Panchal

Ranking: Expert

Mensagens: 287

Data de entrada: 20 de Maio de 2012

Mensagens recentes

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
19 de Setembro de 2012 23:53
Resposta

Vishal Panchal

Ranking: Expert

Mensagens: 287

Data de entrada: 20 de Maio de 2012

Mensagens recentes

Thanks Ivo Ivanov too.
Mazhar Alam
RE: How to get all users assigned to a usergroup
20 de Setembro de 2012 00:01
Resposta

Mazhar Alam

Ranking: Regular Member

Mensagens: 201

Data de entrada: 25 de Novembro de 2011

Mensagens recentes

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
20 de Setembro de 2012 00:03
Resposta

Mazhar Alam

Ranking: Regular Member

Mensagens: 201

Data de entrada: 25 de Novembro de 2011

Mensagens recentes

Seems you got a quick reply..:-)
Vishal Panchal
RE: How to get all users assigned to a usergroup
20 de Setembro de 2012 00:25
Resposta

Vishal Panchal

Ranking: Expert

Mensagens: 287

Data de entrada: 20 de Maio de 2012

Mensagens recentes

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
20 de Setembro de 2012 05:10
Resposta

Mazhar Alam

Ranking: Regular Member

Mensagens: 201

Data de entrada: 25 de Novembro de 2011

Mensagens recentes

Welcome..:-)
Alireza Zare
RE: How to get all users assigned to a usergroup
20 de Setembro de 2012 12:42
Resposta

Alireza Zare

Ranking: Regular Member

Mensagens: 110

Data de entrada: 3 de Setembro de 2010

Mensagens recentes

You are welcome!
Troy Griffitts
RE: How to get all users assigned to a usergroup
18 de Julho de 2013 07:25
Resposta

Troy Griffitts

Ranking: New Member

Mensagens: 18

Data de entrada: 6 de Agosto de 2011

Mensagens recentes

Any idea which jsonws call to use?
Suraj Bihari
RE: How to get all users assigned to a usergroup
13 de Novembro de 2013 13:55
Resposta

Suraj Bihari

Ranking: Junior Member

Mensagens: 42

Data de entrada: 20 de Maio de 2011

Mensagens recentes

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
Bhavik Shah
RE: How to get all users assigned to a usergroup
24 de Maio de 2015 22:36
Resposta

Bhavik Shah

Ranking: Junior Member

Mensagens: 34

Data de entrada: 20 de Maio de 2015

Mensagens recentes

To get users from usergroup, please find below is the code snippet:

ThemeDisplay td = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);

UserGroup ug = UserGroupLocalServiceUtil.getUserGroup(td.getCompanyId(), groupName); // get groupName from preference
List<User> listUsers = UserLocalServiceUtil.getUserGroupUsers(ug.getUserGroupId());