/// <summary> /// Matches the context attribute against the Policy. /// </summary> /// <param name="xacmlAttributeValue">A xacml attribute value</param> /// <returns>A boolean indicating it is a match</returns> public bool IsMatch(XacmlAttributeValue xacmlAttributeValue) { if (this.AttributeValue.DataType.OriginalString.Equals(xacmlAttributeValue.DataType.OriginalString)) { return(AttributeMatcher.MatchAttributes(this.AttributeValue.Value, xacmlAttributeValue.Value, this.MatchId.OriginalString)); } else { // Returns false if datatype is different even the values are the same return(false); } }
/// <summary> /// Matches a string attribute against the policy. /// </summary> /// <param name="contextValue">The value from context.</param> /// <returns>A bool telling if it is a match</returns> public bool IsMatch(string contextValue) { return(AttributeMatcher.MatchAttributes(this.AttributeValue.Value, contextValue, this.MatchId.OriginalString)); }
/// <summary> /// Match Attribute value against input attribute value. /// </summary> /// <param name="matchFunction">The match function.</param> /// <param name="policyAttributeValue">The policy Attribute.</param> /// <returns>A bool indicating it is a match.</returns> public bool MatchAttributeValues(Uri matchFunction, XacmlAttributeValue policyAttributeValue) { return(AttributeMatcher.MatchAttributes(this.value, policyAttributeValue.Value, matchFunction.OriginalString)); }