Geeks With Blogs
AzamSharp Some day I will know everything. I hope that day never comes.

Security trimming is a feature which allows you to hide the urls based on the roles. This mean you can have a single web.sitemap file which contains all the urls of the website. The urls will be served to the users based on the roles. A common place where security trimming is used is when you want to display a menu based on the user role. To get started with sitemap and security trimming check out the following post:

http://geekswithblogs.net/azamsharp/archive/2006/05/02/77018.aspx

Now, sometimes we need to display absolute urls like http://www.gridviewguy.com or www.koffeekoder.com. If security trimming is enabled you won't be able to see these urls even when you are authenticated. The solution is very simple. Place the '*' as a value for the roles attribute in web.sitemap file as shown below:

 <siteMapNode url="~/" title=""  description="">
        <siteMapNode url="~/Default.aspx" title="Home"  description="" />
        <siteMapNode url="~/Members/Add.aspx" title="Add"  description="" roles="Member" />
      <siteMapNode url="http://www.yahoo.com" title="yahoo" roles="*" />
    </siteMapNode>

roles="*' means that the siteMapNode is visible to everyone.

Posted on Monday, March 10, 2008 9:19 AM | Back to top


Comments on this post: Web.siteMap, Security Trimming and Absolute URL'S

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Mohammad Azam | Powered by: GeeksWithBlogs.net