How to get all child nodes without filtering on permissions

Posted by Community Admin on 04-Aug-2018 13:32

How to get all child nodes without filtering on permissions

All Replies

Posted by Community Admin on 03-Feb-2017 00:00

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?

Posted by Community Admin on 03-Feb-2017 00:00
This thread is closed