Search
Sunday, August 01, 2010 ..:: Home ::.. Register  Login
   Calendar  
     
  
   Search  
     
  
   Blogroll  
     
  
   Disclosure  
All blog entries are the opinions of the author and do not necessarily reflect the opinions of their employer. All the code presented is for explanation and demonstration purposes only. Any damages incurred to your site and/or data are not the responsibility of the author. Every effort is taken to ensure the code properly compiles, however sometimes there are some hiccups and you might be required to do your own debugging.
     
  
   TechTidBits (Blog)  
Oct 8

Written by: Peter Henry
Wednesday, October 08, 2008 11:08 PM

Last week I was playing around with the ASP.NET SiteMaps and even though out of the box, it gives you Roles based security, it's not used at runtime. 

What do I mean?  When I create a Web.sitemap, populate it properly with my pages, Urls AND Roles, the nodes for those roles still show up in my TreeView even though I'm not logged in.  What's up with that?

This week from my study group, I learned the secret.  Come in closer for this, this is good!  Turns out the defaults used for the SiteMaps don't actually use the Roles out of the box, you need to do a bit more work.  Namely add a siteMap node to your Web.config and make sure you have securityTrimmingEnabled="true", then you'll have the menus hidden if you're not logged in or don't have the appropriate role specified.

Reference: Source of web.config siteMap information I Googled to get the right xml node

Tags:

Your name:
Title:
Comment:
Add Comment    Cancel  
     
  
Copyright 1999-2010 by PCHenry.com   Terms Of Use  Privacy Statement