Why does this work (returns the correct t/f):
bool IsAdmin = HttpContext.Current.User.IsInRole("MyAdminGroup");
but this does not:
bool IsAdmin = false;
if (HttpContext.Current.User.IsInRole("MyAdminGroup"))
{
IsAdmin = true;
}
This last one always returns false, regardless.
I am building an MVC 4 Intranet site with Windows Auth on.
Go to the complete details ...