Foros de discusión
How to get all users assigned to a usergroup
Vishal Panchal, modificado hace 11 años.
How to get all users assigned to a usergroup
Expert Mensajes: 289 Fecha de incorporación: 20/05/12 Mensajes recientes
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
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, modificado hace 11 años.
RE: How to get all users assigned to a usergroup
Regular Member Mensajes: 110 Fecha de incorporación: 3/09/10 Mensajes recientes
List<User> users = UserLocalServiceUtil.getUserGroupUsers(userGroupId);
Vishal Panchal, modificado hace 11 años.
RE: How to get all users assigned to a usergroup
Expert Mensajes: 289 Fecha de incorporación: 20/05/12 Mensajes recientes
Thanks for the quick response.
It works..!!
Thank you Ivo Alireza Zare.
It works..!!
Thank you Ivo Alireza Zare.
Vishal Panchal, modificado hace 11 años.
RE: How to get all users assigned to a usergroup
Expert Mensajes: 289 Fecha de incorporación: 20/05/12 Mensajes recientes
Thanks Ivo Ivanov too.
Troy Griffitts, modificado hace 10 años.
RE: How to get all users assigned to a usergroup
New Member Mensajes: 18 Fecha de incorporación: 6/08/11 Mensajes recientes
Any idea which jsonws call to use?
Suraj Bihari, modificado hace 10 años.
RE: How to get all users assigned to a usergroup
Junior Member Mensajes: 41 Fecha de incorporación: 20/05/11 Mensajes recientes
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
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
Mazhar Alam, modificado hace 11 años.
RE: How to get all users assigned to a usergroup
Regular Member Mensajes: 191 Fecha de incorporación: 25/11/11 Mensajes recientes
Hi,
You can use UserLocalServiceUtil.getUserGroupUsers(groupId) to get the desired users..Hope this helps..
You can use UserLocalServiceUtil.getUserGroupUsers(groupId) to get the desired users..Hope this helps..
Mazhar Alam, modificado hace 11 años.
RE: How to get all users assigned to a usergroup
Regular Member Mensajes: 191 Fecha de incorporación: 25/11/11 Mensajes recientes
Seems you got a quick reply..:-)
Vishal Panchal, modificado hace 11 años.
RE: How to get all users assigned to a usergroup
Expert Mensajes: 289 Fecha de incorporación: 20/05/12 Mensajes recientesMazhar Alam:
Seems you got a quick reply..:-)
Hi Mazhar Alam,
Yes I got but even thanks for your valuable reply.!
Thanks & Regards,
Vishal R. Panchal
Mazhar Alam, modificado hace 11 años.
RE: How to get all users assigned to a usergroup
Regular Member Mensajes: 191 Fecha de incorporación: 25/11/11 Mensajes recientes
Welcome..:-)
Alireza Zare, modificado hace 11 años.
RE: How to get all users assigned to a usergroup
Regular Member Mensajes: 110 Fecha de incorporación: 3/09/10 Mensajes recientes
You are welcome!
Bhavik Shah, modificado hace 8 años.
RE: How to get all users assigned to a usergroup
Junior Member Mensajes: 64 Fecha de incorporación: 21/05/15 Mensajes recientes
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());
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());