Example usage for com.liferay.portal.kernel.service.permission LayoutPermissionUtil containsWithoutViewableGroup

List of usage examples for com.liferay.portal.kernel.service.permission LayoutPermissionUtil containsWithoutViewableGroup

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.service.permission LayoutPermissionUtil containsWithoutViewableGroup.

Prototype

public static boolean containsWithoutViewableGroup(PermissionChecker permissionChecker, Layout layout,
            boolean checkLayoutUpdateable, String actionId) throws PortalException 

Source Link

Usage

From source file:com.liferay.layout.admin.web.internal.control.menu.CustomizationSettingsProductNavigationControlMenuEntry.java

License:Open Source License

protected boolean isCustomizableLayout(ThemeDisplay themeDisplay) throws PortalException {

    Layout layout = themeDisplay.getLayout();

    Group group = layout.getGroup();

    if (group.isLayoutPrototype() || group.isLayoutSetPrototype() || group.isStagingGroup()
            || group.isUserGroup()) {/* ww  w . j  a  v a  2s  .  com*/

        return false;
    }

    LayoutTypePortlet layoutTypePortlet = themeDisplay.getLayoutTypePortlet();

    if (!layout.isTypePortlet() || (layoutTypePortlet == null)) {
        return false;
    }

    if (layout.isCustomizable() && hasUpdateLayoutPermission(themeDisplay)) {

        return true;
    }

    if (!layoutTypePortlet.isCustomizable()) {
        return false;
    }

    if (!LayoutPermissionUtil.containsWithoutViewableGroup(themeDisplay.getPermissionChecker(), layout, false,
            ActionKeys.CUSTOMIZE)) {

        return false;
    }

    return true;
}

From source file:com.liferay.layout.admin.web.internal.product.navigation.control.menu.InformationMessagesProductNavigationControlMenuEntry.java

License:Open Source License

protected boolean isLinkedLayout(ThemeDisplay themeDisplay) throws PortalException {

    Layout layout = themeDisplay.getLayout();

    Group group = layout.getGroup();

    if (!SitesUtil.isLayoutUpdateable(layout)
            || (layout.isLayoutPrototypeLinkActive() && !group.hasStagingGroup())) {

        if (!LayoutPermissionUtil.containsWithoutViewableGroup(themeDisplay.getPermissionChecker(), layout,
                false, ActionKeys.UPDATE)) {

            return false;
        }/*from  w w  w. j a  v  a2 s  .c  o m*/

        return true;
    }

    return false;
}