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

    if (group.isControlPanel()) {
      return false;
    }

    if (!hasPreviewInDevicePermission(permissionChecker, group)) {
      return false;
    }

    return super.isShow(permissionChecker, group);
  }
예제 #2
0
  private static void _addGroupsBreadcrumbEntries(
      List<BreadcrumbEntry> breadcrumbEntries,
      ThemeDisplay themeDisplay,
      LayoutSet layoutSet,
      boolean includeParentGroups)
      throws Exception {

    Group group = layoutSet.getGroup();

    if (group.isControlPanel()) {
      return;
    }

    if (includeParentGroups) {
      LayoutSet parentLayoutSet = _getParentLayoutSet(layoutSet);

      if (parentLayoutSet != null) {
        _addGroupsBreadcrumbEntries(breadcrumbEntries, themeDisplay, parentLayoutSet, true);
      }
    }

    int layoutsPageCount = 0;

    if (layoutSet.isPrivateLayout()) {
      layoutsPageCount = group.getPrivateLayoutsPageCount();
    } else {
      layoutsPageCount = group.getPublicLayoutsPageCount();
    }

    if ((layoutsPageCount > 0) && !group.isGuest()) {
      String layoutSetFriendlyURL = PortalUtil.getLayoutSetFriendlyURL(layoutSet, themeDisplay);

      if (themeDisplay.isAddSessionIdToURL()) {
        layoutSetFriendlyURL =
            PortalUtil.getURLWithSessionId(layoutSetFriendlyURL, themeDisplay.getSessionId());
      }

      BreadcrumbEntry breadcrumbEntry = new BreadcrumbEntry();

      breadcrumbEntry.setTitle(group.getDescriptiveName(themeDisplay.getLocale()));
      breadcrumbEntry.setURL(layoutSetFriendlyURL);

      breadcrumbEntries.add(breadcrumbEntry);
    }
  }