Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 23rd, 2006, 11:42 PM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Site map security trimming.

Hi all .
I’m new to ASP and ASP 2.0 so please be patience.
I’m reading Marco Bellinaso’s book (ASP 2.0 website programming) and found something that isn’t working as I expect it to work.
I’m talking about the site map data source control – the one that shows the links to the “main” pages / nodes of the site.
From the book (and the link from MSDN - http://msdn2.microsoft.com/en-us/library/ms178428.aspx ) I understand that if one specifies the roles attribute inside the siteMapNode in the site map , this roles list will determine if this node will be visible to the user according to its roles list (if the user is just a member , he can’t see the admin link in the book’s example and so on).
In my web site (where I try to follow the book) this isn’t working. Changing the example from the book result the same results (if I allow all users to the admin folder via its web config the link is visible although the roles list in the site map is limited). It looks like the visibility of the link is NOT connected to the roles attribute on the map node but to the web config of the specific folder.

What am I doing wrong?
I would like to “help” the map provider so it will not have to check the actual page to set the link visibility.
I hope I was clear enough.
If I’m asking the question is the wrong forum please let me know.

Thanks
Amit
  #2 (permalink)  
Old December 24th, 2006, 02:27 AM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 99
Thanks: 0
Thanked 1 Time in 1 Post
Default

Just keep going.

If you try to run the web site with only half of Chapter 4 completed, the role function doesn't have anything to do, so your entire site map will be shown. Once you have the Admin folder and web.config file for the folder set up, it will work as advertised.

  #3 (permalink)  
Old December 24th, 2006, 11:27 AM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the prompt reply.
I know, but if the site map is looking / checking for the folder’s web config file , why do I need the roles attribute in the site map for ?
In the MSDN attached article they claim that the visibility is based on the web config file but one can “help” performance by supplying the roles attribute (save the time to go and check for each folder). That’s when I tried doing it (first on my code and then on the book’s example) to see that it doesn’t work …


Thanks again
Amit



  #4 (permalink)  
Old December 24th, 2006, 02:54 PM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 99
Thanks: 0
Thanked 1 Time in 1 Post
Default

The approach is two prong. MSDN is simply telling you that when the role is set in the site map it bypasses the check of web.config because if the menu option is not available to the user it is not going to be selected. However web.config will be read if someone tries to browse to the page.

  #5 (permalink)  
Old December 24th, 2006, 05:56 PM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Mythical you.
That’s exactly what I don’t see working.
I open chapter 5 code (I played with the other codes so much , just to make sure it’s the original code).
I run the default page , I don’t see the admin link – as we expect.
I go to the web config of the admin folder, and on line 14 – the location tag of the default page I replace the deny users tag to <allow users="*" />. When I run the default page again (main site default) , I can see the admin link although the roles attribute in the sitemap file is intact (if I understand correctly this attribute should have “blocked” the link from the map control).
The roles attribute is not working or I don’t understand something here.

Thanks for your patience.
Amit



  #6 (permalink)  
Old December 25th, 2006, 11:57 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I seem to remember a bug about this. In one of the demos I saw, the presenter said you have to use web.config settings in subfolders to control this. But he wasn't a well known guy so he may have been wrong. He said he couldn't get group security working in the sitemap alone.

I don't use this mechanism myself. I use a third party menu tied to roles in the database.

Eric

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Site Map mallikalapati ASP.NET 2.0 Basics 1 February 9th, 2008 02:56 PM
Passing more than one querystring in the site map kaushikpulpa ASP.NET 2.0 Basics 1 April 20th, 2007 08:08 AM
display hierarchical site map using repeaters wlin ASP.NET 2.0 Basics 1 August 31st, 2006 11:18 AM
display hierarical site map using repeaters wlin ASP.NET 1.0 and 1.1 Basics 0 August 24th, 2006 12:35 PM



All times are GMT -4. The time now is 11:05 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.