Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Jan Agermose
get members of current organisation
February 22, 2013 3:52 AM
Answer

Jan Agermose

Rank: Junior Member

Posts: 55

Join Date: April 9, 2010

Recent Posts

hi

I need to get a list of users/members of the current org. private page where my portlet is placed.

Im using this:
users = UserLocalServiceUtil.getGroupUsers(themeDisplay.getLayout().getGroupId());

(or the getScopedGroupID())

but that works only, it seams, for communities?
Sandeep Nair
RE: get members of current organisation
February 22, 2013 2:08 PM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1692

Join Date: November 5, 2008

Recent Posts

Hi,

Can you try something like this

1Group group = GroupLocalServiceUtil.getGroup(themeDisplay.getLayout().getGroupId());
2
3if(group.isOrganization()){
4  long orgId = group.getClassPK();
5  List <User>users = UserLocalServiceUtil.getOrganizationUsers(orgId);
6}


Regards,
Sandeep