Example usage for com.liferay.portal.kernel.security.permission ActionKeys VIEW_CONTROL_PANEL

List of usage examples for com.liferay.portal.kernel.security.permission ActionKeys VIEW_CONTROL_PANEL

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.security.permission ActionKeys VIEW_CONTROL_PANEL.

Prototype

String VIEW_CONTROL_PANEL

To view the source code for com.liferay.portal.kernel.security.permission ActionKeys VIEW_CONTROL_PANEL.

Click Source Link

Usage

From source file:com.liferay.product.navigation.control.panel.internal.application.list.ControlPanelCategory.java

License:Open Source License

@Override
public boolean isShow(PermissionChecker permissionChecker, Group group) throws PortalException {

    if (PortalPermissionUtil.contains(permissionChecker, ActionKeys.VIEW_CONTROL_PANEL)) {

        return true;
    }// ww  w.j ava2s . c o  m

    return false;
}

From source file:com.liferay.roles.admin.web.internal.portlet.RolesAdminPortlet.java

License:Open Source License

protected void updateViewControlPanelPermission(Role role, long scopeGroupId, String portletId, int scope,
        String[] groupIds) throws Exception {

    PanelCategoryHelper panelCategoryHelper = new PanelCategoryHelper(_panelAppRegistry,
            _panelCategoryRegistry);//from   w  w  w  .  j  av a  2s .  com

    String selResource = null;
    String actionId = null;

    if (panelCategoryHelper.containsPortlet(portletId, PanelCategoryKeys.CONTROL_PANEL)
            && (role.getType() == RoleConstants.TYPE_REGULAR)) {

        selResource = PortletKeys.PORTAL;
        actionId = ActionKeys.VIEW_CONTROL_PANEL;
    } else if (panelCategoryHelper.containsPortlet(portletId, PanelCategoryKeys.SITE_ADMINISTRATION)) {

        selResource = Group.class.getName();
        actionId = ActionKeys.VIEW_SITE_ADMINISTRATION;
    }

    if (selResource != null) {
        updateAction(role, scopeGroupId, selResource, actionId, true, scope, groupIds);
    }
}