G
Guest
Hi,
I'm testing the IsInRole method on my app. I'm using Integrated security so
I'm not sure if that has something to do with it. I have a groups table
which I want to secure certain portions of my application.
In the global.asax:
protected void Application_AcquireRequestState(Object sender, EventArgs e)
{
if (Request.IsAuthenticated)
{
string[] arrRoles = new string[]{"Manager", "Cleaner"};
System.Threading.Thread.CurrentPrincipal = new
System.Security.Principal.GenericPrincipal(Context.User.Identity, arrRoles);
}
}
In a page secured by integrated security I get "false" for the following code:
Context.User.IsInRole("Manager") //-returns false when I thought it should
be true?
Thanks
I'm testing the IsInRole method on my app. I'm using Integrated security so
I'm not sure if that has something to do with it. I have a groups table
which I want to secure certain portions of my application.
In the global.asax:
protected void Application_AcquireRequestState(Object sender, EventArgs e)
{
if (Request.IsAuthenticated)
{
string[] arrRoles = new string[]{"Manager", "Cleaner"};
System.Threading.Thread.CurrentPrincipal = new
System.Security.Principal.GenericPrincipal(Context.User.Identity, arrRoles);
}
}
In a page secured by integrated security I get "false" for the following code:
Context.User.IsInRole("Manager") //-returns false when I thought it should
be true?
Thanks