public MatchResult Evaluate(AuthorizationContext authorizationContext) { foreach (var allOf in AllOf) if (allOf.Evaluate(authorizationContext) == MatchResult.True) return MatchResult.True; return MatchResult.False; }
public MatchResult Evaluate(AuthorizationContext authorizationContext) { foreach (var match in Matches) if (match.Evaluate(authorizationContext) == MatchResult.False) return MatchResult.False; return MatchResult.True; }
public MatchResult Evaluate(AuthorizationContext authorizationContext) { foreach (var attributeCategory in authorizationContext.AttributeCategories) if (Evaluate(attributeCategory) == MatchResult.True) return MatchResult.True; return MatchResult.False; }
/// <summary> /// <see cref="http://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-os-en.html#_Toc325047188">Rule evaluation</see> /// </summary> /// <param name="authorizationContext"></param> /// <returns></returns> public Decision Evaluate(AuthorizationContext authorizationContext) { // not using conditions right now, so the rule table will always be // true for the condition column var matchResult = Target != null ? Target.Evaluate(authorizationContext) : MatchResult.True; switch (matchResult) { case MatchResult.True: if (Effect == RuleEffect.Permit) return Decision.Permit; return Decision.Deny; case MatchResult.False: return Decision.NotApplicable; case MatchResult.Indeterminate: if (Effect == RuleEffect.Permit) return Decision.Indeterminate | Decision.Permit; return Decision.Indeterminate | Decision.Deny; } throw new Exception("Invalid match result detected."); }
public ICollection<PolicySet> GetApplicablePolicySets(AuthorizationContext authorizationContext) { var applicablePolicySets = new List<PolicySet>(); foreach (var policySet in PolicySets) if (policySet.Target.Evaluate(authorizationContext) == MatchResult.True) applicablePolicySets.Add(policySet); return applicablePolicySets; }
public abstract Decision Evaluate(IEnumerable<IDecisionEvaluator> evaluators, AuthorizationContext context);
public AuthorizationRequest(AuthorizationContext authorizationContext) { AuthorizationContext = authorizationContext; }
public Decision Evaluate(AuthorizationContext authorizationContext) { return CombiningAlgorithm.Evaluate(Rules, authorizationContext); }