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

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

Introduction

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

Prototype

public static java.util.List<com.liferay.portal.kernel.model.User> getCompanyUsers(long companyId, int start,
        int end) 

Source Link

Document

Returns a range of all the users belonging to the company.

Usage

From source file:eu.gerhards.liferay.services.angular.service.impl.AngularUserServiceImpl.java

License:Open Source License

@Override
public List<User> getCompanyUsers(long companyId) throws PortalException {

    _log.info("Getting company user for company with id: " + String.valueOf(companyId));

    _log.debug("    ... security check ...");

    PortalPermissionUtil.check(getPermissionChecker(), AngularActionKeys.LIST_USERS);

    _log.debug("    ... getting information");

    int count = UserLocalServiceUtil.getCompanyUsersCount(companyId);
    List<User> users = new ArrayList<>();

    if (count > 0) {
        users = UserLocalServiceUtil.getCompanyUsers(companyId, 0, count - 1);
    }/*w  w  w  .  j a  va  2 s  .co m*/

    return users;
}