Example usage for com.liferay.portal.kernel.service UserLocalServiceUtil getRoleUserIds

List of usage examples for com.liferay.portal.kernel.service UserLocalServiceUtil getRoleUserIds

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.service UserLocalServiceUtil getRoleUserIds.

Prototype

public static long[] getRoleUserIds(long roleId) 

Source Link

Document

Returns the primary keys of all the users belonging to the role.

Usage

From source file:com.liferay.calendar.internal.upgrade.v1_0_5.UpgradeCalendarResource.java

License:Open Source License

protected long getCompanyAdminUserId(Company company) throws PortalException {

    Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(), RoleConstants.ADMINISTRATOR);

    long[] userIds = UserLocalServiceUtil.getRoleUserIds(role.getRoleId());

    return userIds[0];
}