Example usage for com.liferay.portal.kernel.model User getMySiteGroups

List of usage examples for com.liferay.portal.kernel.model User getMySiteGroups

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.model User getMySiteGroups.

Prototype

public java.util.List<Group> getMySiteGroups() throws com.liferay.portal.kernel.exception.PortalException;

Source Link

Usage

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

License:Open Source License

@Override
public List<Group> getUserSites(long userId) throws PortalException {

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

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

    PortalPermissionUtil.check(getPermissionChecker(), ActionKeys.VIEW);

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

    User user = UserLocalServiceUtil.getUser(userId);
    List<Group> groups = new ArrayList<>();

    if (user != null) {
        groups = user.getMySiteGroups();
    }// w ww . j a  v a 2 s .co m

    return groups;
}