refactor: Rename param from requiredValues to allowedValues to better indicate usage. (#1908)

This commit is contained in:
Ben McCallum 2018-11-13 23:05:55 +01:00 committed by Hao Kung
parent cb83e4f485
commit 42dd66647d
1 changed files with 6 additions and 6 deletions

View File

@ -96,16 +96,16 @@ namespace Microsoft.AspNetCore.Authorization
/// to the current instance. /// to the current instance.
/// </summary> /// </summary>
/// <param name="claimType">The claim type required.</param> /// <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> /// <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) if (claimType == null)
{ {
throw new ArgumentNullException(nameof(claimType)); throw new ArgumentNullException(nameof(claimType));
} }
return RequireClaim(claimType, (IEnumerable<string>)requiredValues); return RequireClaim(claimType, (IEnumerable<string>)allowedValues);
} }
/// <summary> /// <summary>
@ -113,16 +113,16 @@ namespace Microsoft.AspNetCore.Authorization
/// to the current instance. /// to the current instance.
/// </summary> /// </summary>
/// <param name="claimType">The claim type required.</param> /// <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> /// <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) if (claimType == null)
{ {
throw new ArgumentNullException(nameof(claimType)); throw new ArgumentNullException(nameof(claimType));
} }
Requirements.Add(new ClaimsAuthorizationRequirement(claimType, requiredValues)); Requirements.Add(new ClaimsAuthorizationRequirement(claimType, allowedValues));
return this; return this;
} }