Skip to main content

core.satisfiedaccesspolicy

Home > @medplum/core > satisfiedAccessPolicy

satisfiedAccessPolicy() function

Checks that there is an access policy permitting the given resource interaction, returning the matching policy object.

Signature:

export declare function satisfiedAccessPolicy(resource: Resource, interaction: AccessPolicyInteraction, accessPolicy: AccessPolicy | undefined): AccessPolicyResource | undefined;

Parameters

Parameter

Type

Description

resource

Resource

The resource being acted upon.

interaction

AccessPolicyInteraction

The interaction being performed on the resource.

accessPolicy

AccessPolicy | undefined

The relevant access policy for the current user.

Returns:

AccessPolicyResource | undefined

The satisfied access policy, or undefined if the access policy does not permit the given interaction.