problem with .IsInRole

G

Guest

Hello!

I have a strange problem with .IsInRole method. When I use this method on my
development machine everything works fine. However when I deploy my
application on a production server this method does not work correct.

I use the following code:

String DefaultAdminRole = @"dom\admgroup";
String UserName="";
WindowsPrincipal AuthenticatedUser = User as WindowsPrincipal;

if (null!=AuthenticatedUser)
{

UserName = AuthenticatedUser.Identity.Name;

if (!AuthenticatedUser.IsInRole(@"dom\admgroup")){
Response.Write("You do not have permissions!");
}

else
{

Response.Write("You have permissions");

}

IsInRole is always false on production server, no matter who user is...

My development machine is Windows XP with IIS 5.1
Production server is Windows 2000 with IIS 5.0

The Authentication settings in IIS on both machines are excatly the same
(Windows Ingegrated Authentication).

Please, could anyone advice me, what could be wrong? Your help is very much
appreciated!

Thanks!

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,814
Latest member
SpicetreeDigital

Latest Threads

Top