Modify warning about policy behavior (#924)

This commit is contained in:
Ryan Brandenburg 2016-07-28 16:55:08 -07:00 committed by GitHub
parent 763df65c14
commit c16fc06cb9
1 changed files with 3 additions and 1 deletions

View File

@ -45,7 +45,9 @@ namespace Microsoft.AspNetCore.Authorization
/// <returns>The named <see cref="AuthorizationPolicy"/>.</returns>
public virtual Task<AuthorizationPolicy> GetPolicyAsync(string policyName)
{
// MVC relies on DefaultAuthorizationPolicyProvider providing the same policy for the same requests.
// MVC caches policies specifically for this class, so this method MUST return the same policy per
// policyName for every request or it could allow undesired access. It also must return synchronously.
// A change to either of these behaviors would require shipping a patch of MVC as well.
return Task.FromResult(_options.GetPolicy(policyName));
}
}