refactor: Rename param from requiredValues to allowedValues to better indicate usage. (#1908)
This commit is contained in:
parent
cb83e4f485
commit
42dd66647d
|
|
@ -96,16 +96,16 @@ namespace Microsoft.AspNetCore.Authorization
|
|||
/// to the current instance.
|
||||
/// </summary>
|
||||
/// <param name="claimType">The claim type required.</param>
|
||||
/// <param name="requiredValues">Values the claim must process one or more of for evaluation to succeed.</param>
|
||||
/// <param name="allowedValues">Values the claim must process one or more of for evaluation to succeed.</param>
|
||||
/// <returns>A reference to this instance after the operation has completed.</returns>
|
||||
public AuthorizationPolicyBuilder RequireClaim(string claimType, params string[] requiredValues)
|
||||
public AuthorizationPolicyBuilder RequireClaim(string claimType, params string[] allowedValues)
|
||||
{
|
||||
if (claimType == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(claimType));
|
||||
}
|
||||
|
||||
return RequireClaim(claimType, (IEnumerable<string>)requiredValues);
|
||||
return RequireClaim(claimType, (IEnumerable<string>)allowedValues);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -113,16 +113,16 @@ namespace Microsoft.AspNetCore.Authorization
|
|||
/// to the current instance.
|
||||
/// </summary>
|
||||
/// <param name="claimType">The claim type required.</param>
|
||||
/// <param name="requiredValues">Values the claim must process one or more of for evaluation to succeed.</param>
|
||||
/// <param name="allowedValues">Values the claim must process one or more of for evaluation to succeed.</param>
|
||||
/// <returns>A reference to this instance after the operation has completed.</returns>
|
||||
public AuthorizationPolicyBuilder RequireClaim(string claimType, IEnumerable<string> requiredValues)
|
||||
public AuthorizationPolicyBuilder RequireClaim(string claimType, IEnumerable<string> allowedValues)
|
||||
{
|
||||
if (claimType == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(claimType));
|
||||
}
|
||||
|
||||
Requirements.Add(new ClaimsAuthorizationRequirement(claimType, requiredValues));
|
||||
Requirements.Add(new ClaimsAuthorizationRequirement(claimType, allowedValues));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue