Example usage for com.liferay.portal.kernel.model LayoutConstants TYPE_CONTROL_PANEL

List of usage examples for com.liferay.portal.kernel.model LayoutConstants TYPE_CONTROL_PANEL

Introduction

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

Prototype

String TYPE_CONTROL_PANEL

To view the source code for com.liferay.portal.kernel.model LayoutConstants TYPE_CONTROL_PANEL.

Click Source Link

Usage

From source file:com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.java

License:Open Source License

protected void initNewLayoutPermissions(long companyId, long groupId, long userId, Layout layout,
        Layout importedLayout, boolean privateLayout) throws Exception {

    boolean addGroupPermissions = true;

    Group group = importedLayout.getGroup();

    if (privateLayout && group.isUser()) {
        addGroupPermissions = false;/*from ww w  .  ja v  a 2s  .co  m*/
    }

    boolean addGuestPermissions = false;

    if (!privateLayout || Objects.equals(layout.getType(), LayoutConstants.TYPE_CONTROL_PANEL)) {

        addGuestPermissions = true;
    }

    _resourceLocalService.addResources(companyId, groupId, userId, Layout.class.getName(),
            importedLayout.getPlid(), false, addGroupPermissions, addGuestPermissions);
}