protected void renderSection(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Section section, List visibleIds, List checkedIds, List selectableIds, boolean checkPermissions, boolean showHiddenPages) {
if (!showHiddenPages && !section.isVisible().booleanValue()) return;
if (checkPermissions) {
SectionPermission viewPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_VIEW);
boolean canView = UserStatus.lookup().hasPermission(viewPerm);
if (!canView)
return;
}
if (visibleIds != null && !visibleIds.contains(section.getId())) return;
boolean current = section.equals(NavigationManager.lookup().getCurrentSection());
setAttribute("current", current);
renderFragment("sectionStart");
setAttribute("name", StringEscapeUtils.escapeHtml(getLocalizedValue(section.getTitle())));
setAttribute("url", UIServices.lookup().getUrlMarkupGenerator().getLinkToPage(section, true));
setAttribute("id", section.getId());
setAttribute("current", current);
setAttribute("isRoot", section.isRoot());
setAttribute("hasChildren", section.getChildren() != null && !section.getChildren().isEmpty());
setAttribute("checked", checkedIds == null || checkedIds.contains(section.getId()));
setAttribute("selectable", selectableIds == null || selectableIds.contains(section.getId()));
SectionPermission sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_EDIT);
setAttribute("editSection", UserStatus.lookup().hasPermission(sectionPerm));
sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_EDIT_PERMISSIONS);
setAttribute("editPermissions", UserStatus.lookup().hasPermission(sectionPerm));