Re: User.IsInRole with * wildcard, web.sitemap etc.
- From: Alexey Smirnov <alexey.smirnov@xxxxxxxxx>
- Date: Mon, 09 Jul 2007 12:58:57 -0700
On Jul 9, 7:20 pm, "Tim Mackey" <tim.mac...@xxxxxxxxxxxxxxxx> wrote:
hi,
User.IsInRole method appears not to work with the web.sitemap * 'all roles'
wildcard. is this by design? do i have to handle wildcards manually?
ideally User.IsInRole("*") would return true if the user is in any role. an
example is below to illustrate.
i have a sitemap node like so:
<siteMapNode title="Report xyz" description="etc" url="Reports.aspx?sp=XYZ"
roles="*">
since i'm using the querystring to specify a sproc, i make sure to verify
that the user is allowed to access it, as defined in web.sitemap. so i have
code in Reports.aspx that goes like:
foreach (string role in siteMapNode.Roles)
if (User.IsInRole(role))
return; // OK
thanks for any help
tim
Tim, it makes no sense to worry about (*). If you have roles="*" then
you don't need to check anything, because any role is ok.
.
- Prev by Date: Re: Role based security with forms authentication
- Next by Date: Re: Setting up ASP.NET Configuration in Visual Studio 2005
- Previous by thread: Re: Role based security with forms authentication
- Next by thread: Re: User.IsInRole with * wildcard, web.sitemap etc.
- Index(es):
Relevant Pages
|