Example usage for com.liferay.portal.util PropsValues LAYOUT_USER_PRIVATE_LAYOUTS_POWER_USER_REQUIRED

List of usage examples for com.liferay.portal.util PropsValues LAYOUT_USER_PRIVATE_LAYOUTS_POWER_USER_REQUIRED

Introduction

In this page you can find the example usage for com.liferay.portal.util PropsValues LAYOUT_USER_PRIVATE_LAYOUTS_POWER_USER_REQUIRED.

Prototype

boolean LAYOUT_USER_PRIVATE_LAYOUTS_POWER_USER_REQUIRED

To view the source code for com.liferay.portal.util PropsValues LAYOUT_USER_PRIVATE_LAYOUTS_POWER_USER_REQUIRED.

Click Source Link

Usage

From source file:com.liferay.portlet.mypages.MyPagesControlPanelEntry.java

License:Open Source License

public boolean isVisible(PermissionChecker permissionChecker, Portlet portlet) throws Exception {

    boolean hasPowerUserRole = RoleLocalServiceUtil.hasUserRole(permissionChecker.getUserId(),
            permissionChecker.getCompanyId(), RoleConstants.POWER_USER, true);

    if (PropsValues.LAYOUT_USER_PRIVATE_LAYOUTS_MODIFIABLE
            && (!PropsValues.LAYOUT_USER_PRIVATE_LAYOUTS_POWER_USER_REQUIRED || hasPowerUserRole)) {

        return true;
    }//from   w  ww.j a  v a2  s.c om

    if (PropsValues.LAYOUT_USER_PUBLIC_LAYOUTS_MODIFIABLE
            && (!PropsValues.LAYOUT_USER_PUBLIC_LAYOUTS_POWER_USER_REQUIRED || hasPowerUserRole)) {

        return true;
    }

    return false;
}