pub fn evaluate(
policies: &[PolicyDocument],
request: &EvalRequest<'_>,
) -> DecisionExpand description
Evaluate a request against a set of policy documents.
Implements AWS’s standard identity-policy evaluation logic for Phase 1 features only. See the module-level docstring for the exhaustive list of what is and isn’t covered.
§Algorithm
- Walk every statement in every policy.
- For each statement that matches the request’s action and resource:
- If the statement has a
Conditionblock, evaluate it againstEvalRequest::context; skip the statement if the condition does not match. - If
Effect: Deny→ returnDecision::ExplicitDenyimmediately. - If
Effect: Allow→ record that we saw an allow.
- If the statement has a
- After all statements are scanned: return
Decision::Allowif any allow matched, otherwiseDecision::ImplicitDeny.