Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@ -60,13 +60,7 @@ namespace System.Web.Security
return;
HttpRequest req = context.Request;
#if NET_2_0
AuthorizationSection config = (AuthorizationSection) WebConfigurationManager.GetSection ("system.web/authorization", req.Path, context);
#else
AuthorizationConfig config = (AuthorizationConfig) context.GetConfig ("system.web/authorization");
if (config == null)
return;
#endif
if (!config.IsValidUser (context.User, req.HttpMethod)) {
HttpException e = new HttpException (401, "Unauthorized");
HttpResponse response = context.Response;
@ -77,14 +71,12 @@ namespace System.Web.Security
}
}
#if NET_2_0
public static bool CheckUrlAccessForPrincipal (string virtualPath, IPrincipal user, string verb)
{
AuthorizationSection config = (AuthorizationSection) WebConfigurationManager.GetSection ("system.web/authorization", virtualPath);
return config == null ? true : config.IsValidUser (user, verb);
}
#endif
}
}