How to get all child nodes without filtering on permissions
We have a custom widget used to build a side navigation menu. For earlier Sitefinity versions the code would show all child nodes that had the "Show in navigation" box checked, even if the active user did not have permissions to view the node.
The code is like this:
var topNode = SiteMapBase.GetActualCurrentNode();
if (topNode != null)
while (!String.IsNullOrEmpty(topNode.ParentNode.Title) && (topNode.ParentNode.Title != "Pages"))
topNode = (PageSiteNode) topNode.ParentNode;
TreeNav.NodeDataBound += SideNav_NodeDataBound;
TreeNav.DataSource = topNode.ChildNodes;
TreeNav.DataBind();
Now for sites upgraded to the 9.x versions of Sitefinity, this code filters out nodes where the active user doesn't have view permissions. How can we make this display all published nodes regardless of the node permissions settings?
I found this solution in the Progress Knowledge Base: http://knowledgebase.progress.com/articles/Article/Extend-Sitefinity-SiteMap-show-all-nodes-in-the-navigation-get-protected