On this page

core.satisfiedaccesspolicies

Home > @medplum/core > satisfiedAccessPolicies

satisfiedAccessPolicies() function​

Finds the access policy entry that permits each interaction on a resource. Equivalent to calling satisfiedAccessPolicy for each interaction, but evaluates each entry's criteria at most once.

Signature:

export declare function satisfiedAccessPolicies(resource: Resource, interactions: readonly AccessPolicyInteraction[], accessPolicy: AccessPolicy): (AccessPolicyResource | undefined)[];

Parameters​

Parameter

Type

Description

resource

Resource

The resource being acted upon.

interactions

readonly AccessPolicyInteraction[]

The interactions being performed on the resource.

accessPolicy

AccessPolicy

The relevant access policy for the current user.

Returns:

(AccessPolicyResource | undefined)[]

The satisfied access policy for each interaction, in the same order, or undefined where none permits it.