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

ParameterTypeDescription
resourceResourceThe resource being acted upon.
interactionAccessPolicyInteractionThe interaction being performed on the resource.
accessPolicyAccessPolicy | undefinedThe 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.