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

Forums / Developing with Sitefinity / Disabling nodes - sitemappanel.ascx

Disabling nodes - sitemappanel.ascx

2 posts, 0 answered
  1. Karl
    Karl avatar
    45 posts
    Registered:
    18 Jun 2009
    05 Apr 2011
    Link to this post
    Hi,
    Is it possible to hide / disable nodes in the admin sitemap panel based on role permissions? Ideally, rather than display all pages, we would like to hide the pages that a particular role does not have permission to edit. Is this something that can be accomplished.

    Many thanks.
    Karl.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Apr 2011
    Link to this post
    Hello Karl,

    You can access the backend RadTreeView control from
    Sitefinity\Admin\ControlTemplates\Pages\SiteMapPanel.ascx

    and hide the nodes you would like.


    sample

    protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            var nodes = SiteNavigation.GetAllNodes();
            foreach (RadTreeNode n in nodes)
            {
                n.Enabled = false;
            }
        }
    All the best,
    Ivan Dimitrov
    the Telerik team

2 posts, 0 answered