This is a migrated thread and some comments may be shown as answers.

Display Nodes based on authority

2 Answers 102 Views
SiteMap
This is a migrated thread and some comments may be shown as answers.
Daniel Lopez
Top achievements
Rank 1
Daniel Lopez asked on 20 Jan 2010, 06:01 PM
Hello, standard site navigation can display nodes based on their authority to the navigate url page. Does SiteMap have the same functionality?

this functionality is generally handled by a setting in the web.config file.

Please let me know.
Thanks

2 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 28 Jan 2010, 01:44 PM
Hello Daniel Lopez,

What you are referring to is called 'Security Trimming'. It is supported at the SiteMapProvder level.

You can enable it by configuring the Provided in the way shown in below example:

<system.web>
<!-- …other configuration settings -->
  <siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
    <providers>
      <add name="XmlSiteMapProvider"
        description="Default SiteMap provider."
        type="System.Web.XmlSiteMapProvider "
        siteMapFile="Web.sitemap"
        securityTrimmingEnabled="true" />
    </providers>
  </siteMap>
</system.web>

Once the Provider is configured, any SiteMap (including our RadSiteMap) will show data based on the permissions of the current user.

You can read more about the feature here.

Sincerely yours,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Danny
Top achievements
Rank 2
answered on 18 Jul 2012, 02:22 PM
Don't forget to set roles="*" in the root node as explained from the following extracted from  http://msdn.microsoft.com/en-us/library/ms178428.aspx 

It is recommended that the root node in a site map allow everyone access. To do this, set the roles attribute to an asterisk (*), or wildcard character, as shown in the following code example.

<?xml version="1.0" encoding="utf-8" ?>
<siteMap>
  <siteMapNode title="Home" description="Home" 
    url="default.aspx" roles="*">
    <!-- other <siteMapNode> elements -->
  </siteMapNode>
</siteMap>

In a site map, you can reference URLs that are outside of your Web application. Access to a URL outside of the application cannot be tested by ASP.NET. Therefore, if you enable security trimming, the site-map node will not be visible unless you set the roles attribute to an asterisk (*), which enables all clients to view the site-map node without first testing access to the URL.

Tags
SiteMap
Asked by
Daniel Lopez
Top achievements
Rank 1
Answers by
Simon
Telerik team
Danny
Top achievements
Rank 2
Share this question
or