1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / How to get all child nodes without filtering on permissions

How to get all child nodes without filtering on permissions

2 posts, 1 answered
  1. Dave
    Dave avatar
    4 posts
    Registered:
    10 Jun 2015
    03 Feb
    Link to this post

    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?

    Answered
  2. Dave
    Dave avatar
    4 posts
    Registered:
    10 Jun 2015
2 posts, 1 answered