RE: ASP.NET 2.0 Authorization based on Combination of Allow/Deny Users/Roles.



Hi Douglas,

The roles attribute in <siteMapNode> is used to expand the allowable users,
not to restrict them. This is designed so because Sitemap already
integrates with authentication. In other word, it's the <authorization>
rules in web.config determines which sitemap node will be displayed to user
when a user with specific role logs in. Normally you only need to use roles
attribute on a sitemap node that doesn't have an url attribute. For
example, add roles="*" when the node is a parent type node without actual
url.

I understand that the issue here is that <authorization> rules doesn't
permit AND, OR combination of different roles. The <allow> or <deny> rules
are evaluated from top to down, whenever a rule succeeds, remaining rules
will not be evaluted.

To learn how a HttpModule could be built to handle these authorization
rules, you might want to use Reflector
(http://www.aisto.com/roeder/dotnet/) to view the implementation of
System.Web.Security.UrlAuthorizationModule.

Hope this helps.

Sincerely,
Walter Wang (wawang@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • RE: Securing a single aspx page
    ... forms authentication by default will allow everyone access ... authorization setting: ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Securing a single aspx page
    ... forms authentication by default will allow everyone access ... authorization setting: ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Web Deployment Project location/Authorization replacement
    ... During "Release" the test role is not authorized in the sub directory. ... authorization works fine. ... Microsoft Online Support ... nature are best handled working with a dedicated Microsoft Support Engineer ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: TreeView SiteMapDataSource
    ... the ASP.NET 2.0 Sitemap provider based navigation engine does ... allow us to do some dynamic customization on the sitemap structure that ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.general)
  • Re: strange security role issue
    ... As for the authorization, here is the setting, for a section that should not be viewable by a new user: ... But this seems only to reproduce the functionality that security trimming provides, and is not required, correct? ... Microsoft MSDN Online Support Lead ... from the community or a Microsoft Support ...
    (microsoft.public.vsnet.general)