Modify warning about policy behavior (#924)
This commit is contained in:
parent
763df65c14
commit
c16fc06cb9
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue