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

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

Introduction

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

Prototype

boolean SITES_CONTROL_PANEL_MEMBERS_VISIBLE

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

Click Source Link

Usage

From source file:com.liferay.portlet.sitesadmin.SitesControlPanelEntry.java

License:Open Source License

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

    if (PropsValues.SITES_CONTROL_PANEL_MEMBERS_VISIBLE) {
        LinkedHashMap<String, Object> groupParams = new LinkedHashMap<String, Object>();

        groupParams.put("site", true);
        groupParams.put("usersGroups", permissionChecker.getUserId());

        int count = GroupLocalServiceUtil.searchCount(permissionChecker.getCompanyId(), null, null,
                groupParams);//from   www .  j  a v a2s.  co  m

        if (count > 0) {
            return true;
        }
    }

    return false;
}

From source file:com.liferay.site.admin.web.internal.portlet.SiteAdminControlPanelEntry.java

License:Open Source License

@Override
protected boolean hasPermissionImplicitlyGranted(PermissionChecker permissionChecker, Group group,
        Portlet portlet) throws Exception {

    if (PropsValues.SITES_CONTROL_PANEL_MEMBERS_VISIBLE) {
        LinkedHashMap<String, Object> groupParams = new LinkedHashMap<>();

        groupParams.put("site", Boolean.TRUE);
        groupParams.put("usersGroups", permissionChecker.getUserId());

        int count = _groupLocalService.searchCount(permissionChecker.getCompanyId(), null, null, groupParams);

        if (count > 0) {
            return true;
        }/*from  w w  w. j  a v a 2s. co  m*/
    }

    return super.hasPermissionImplicitlyGranted(permissionChecker, group, portlet);
}