Page populatedPage = getBuilderService(iwc).getPage(String.valueOf(page.getNodeID())); hasPermission = iwc.hasViewPermission(populatedPage);
String pageKey = String.valueOf(page.getNodeID());   hasPermission = iwc.getAccessController().hasViewPermissionForPageKey(pageKey,iwc);
	protected int addToTree(IWContext iwc, Collection childrenCollection, UIComponent pageList, int row, int depth) {				List pagesList = new ArrayList(childrenCollection);		if (getDepthOrderPagesAlphabetically(depth)) {			Collections.sort(pagesList, new ICTreeNodeComparator(iwc.getCurrentLocale()));		}				Iterator children = pagesList.iterator();		while (children.hasNext()) {			ICTreeNode page = (ICTreeNode) children.next();			boolean hasPermission = true;			try {				Page populatedPage = getBuilderService(iwc).getPage(String.valueOf(page.getNodeID()));				hasPermission = iwc.hasViewPermission(populatedPage);			}			catch (Exception re) {				log(re);			}			if (hasPermission) {				UIComponent nodeComponent = getNodeComponent(pageList,row,depth);								addObject(iwc, page, nodeComponent, row, depth);				row = setRowAttributes(nodeComponent, page, row, depth, !children.hasNext());				if (isOpen(page) && page.getChildCount() > 0) {					UIComponent newList = getSubTreeComponent(nodeComponent,row,depth);					row = addToTree(iwc, page.getChildren(), newList, row, depth + 1);				}			}		}		return row;	}