Re: User.IsInRole

From: Frank Racis (frank.racis@smed.com)
Date: 07/04/02


From: "Frank Racis" <frank.racis@smed.com>
Date: Thu, 4 Jul 2002 02:19:35 -0400


That didn't work for me. I needed to use "BUILTIN\\Administrators" (with a
capital A). The IsInRole check is case sensitive on the entire string,
both the machine/domain name and the user name. From some quick testing,
the machine/domain is always uppercase, and the group is however it's
entered in user manager.

I'm wondering whether this should be reported as a bug. Everywhere else in
Windows, the names of users, groups, and domains are case-insensitive.
Having them case-sensitive for this call just seems wrong.

-Frank

"Willy Denoyette [MVP]" <willy.denoyette@pandora.be> wrote in message
news:u$4PHRHHCHA.2248@tkmsftngp04...
> Administrators is a builtin group, use this "BUILTIN\\administrators" for
administrators and other predefined groups.
> Use "machine\\userdefinedgroup" for user defined groups (where machine
stands for amachinename or domain name).
>
> Willy.
>
> "Colin" <colinjwhite74@hotmail.com> wrote in message
news:10be801c218c5$9f912a30$9be62ecf@tkmsftngxa03...
> > I have the following setup:
> > -IIS Security = NT Authentication
> > -web.config = <identity impersonate = "true" />
> >
> > running "Response.Write(User.Identity.Name)"
> > will return (mydomain\login)
> >
> > I am an admin on the machine. If I run
> > "Response.Write(User.Isinrole("Administrators"))"
> > it returns false
> >
> > I am ultimately trying to block visibility and disable
> > certain controls based on the user. I have a "Managers"
> > group on the webserver, but I cannot seem to get my app
> > to recognize that the user is part of this group using
> > the above method. ???????????? Can anyone shed some more
> > light on how to go about this? Thanks :)
>
>