Skip to main content

evaluate_policies

Function evaluate_policies 

Source
pub async fn evaluate_policies<CTX: Send + Sync + Clone + 'static, Client: FHIRClient<CTX, OperationOutcomeError> + Send + Sync + 'static>(
    context: PolicyContext<CTX, Client>,
    policies: &Vec<Arc<AccessPolicyV2>>,
) -> Result<PolicyContext<CTX, Client>, OperationOutcomeError>
Expand description

Evaluates a list of access policies and returns the updated policy context when access is granted.

Policies are evaluated in order. The first policy returning PermissionLevel::Allow grants access.

ยงErrors

Returns OperationOutcomeError when:

  • no policy grants access,
  • the evaluated policy returns an evaluation error,
  • the policy context cannot be recovered after granting access.