writerus drivelus
What in heavens name am I doing?
Site Sections
Home
Contact
Syndication
Login
Posts
301
Comments
28
Trackbacks
210
<< Titter
|
Home
|
Sheer Genius >>
SiteMap, Roles and Authorization
A while ago I talked about
navigation and security trimming in ASP.NET 2.0
, and someone asked about this on as ASPAdvice list. Luckily a couple of the team members (thanks Ting-Hao and Stefan) stepped in to correct a few misconceptions. The <authorization> section of web.config controls who has access to the page, and this is the case whether or not security trimming and site maps are being used; it protects against direct url access and controls user and role based access. When using the site maps and a navigation control, then the menus are built using this information too - so if a user isn't authorized for a page then the node isn't displayed (in fact it's not even returned from the provider to the UI). The use of the roles attribute on the siteMapNode elements doesn't affect the authorization, it simply affects whether the item is shown on the menu. The reason for having control here is that it allows menu items to show even if the current user doesn't have access to that page. They can select the menu item, but if not authorized then they'll be redirected to the login page. This is useful for people who wear multiple hats, and have multiple logins; the UI can be the same while they are logged into a low privilege account, and trying to access a priviliged page will prompt them to log in. So unless you need this feature, the only thing you need to do to set the visibility of menu items is to restrict their access via the <authorization> section.
posted on Wednesday, March 02, 2005 9:44 AM
Print
Comments have been closed on this topic.
Article Categories
.net
Archives
September, 2008 (1)
August, 2008 (4)
July, 2008 (6)
June, 2008 (2)
April, 2008 (2)
March, 2008 (6)
February, 2008 (3)
January, 2008 (3)
November, 2007 (4)
October, 2007 (1)
September, 2007 (4)
August, 2007 (1)
July, 2007 (2)
June, 2007 (4)
May, 2007 (4)
April, 2007 (2)
March, 2007 (2)
February, 2007 (6)
January, 2007 (12)
December, 2006 (3)
November, 2006 (7)
October, 2006 (8)
September, 2006 (9)
August, 2006 (3)
July, 2006 (6)
June, 2006 (6)
May, 2006 (7)
April, 2006 (1)
March, 2006 (1)
February, 2006 (9)
January, 2006 (7)
December, 2005 (7)
November, 2005 (12)
October, 2005 (13)
September, 2005 (2)
August, 2005 (6)
July, 2005 (6)
June, 2005 (8)
May, 2005 (6)
April, 2005 (8)
March, 2005 (5)
February, 2005 (4)
January, 2005 (2)
November, 2004 (6)
October, 2004 (8)
September, 2004 (3)
August, 2004 (7)
July, 2004 (11)
June, 2004 (8)
May, 2004 (5)
April, 2004 (7)
March, 2004 (14)
February, 2004 (10)
January, 2004 (7)
Post Categories
writing
talks
life
music
trips
.net
books
film
Software
This Sucks
misc
WebDD
remixuk08
Image Galleries
PDC 2003
.NET Day Vienna 2004
Katie
Misc
Berlin May 2004
TechEd May 2004
G3 2004
blogroll
Dan Maharry
Frog Box
Neil Gaiman
Notes from a small island
Copyright © 2005 Dave Sussman
This work is licensed under a
Creative Commons License