# Check what a member may do with a resource

Canonical page: https://docs.ovok.com/api/access-policies/check-what-a-member-may-do-with-a-resource

`POST /v1/access-policies/check`

Shows what a member's own access policy lets them do with one resource of the project. It answers by the rule Medplum would match, and lists what that rule hides.

**Scope:** the caller's project (from the token).

## Behaviour

- `person` is the member's profile, such as `Practitioner/123`. `resource` is a resource of the project, such as `Patient/456`. `interaction` is `read` by default.
- The caller must be able to read `resource` themselves. Otherwise the answer is `404`, so the check reveals nothing the caller's own policy hides.
- The policy is the member's own, as Medplum builds it at sign-in: every policy on the membership, with each `access` entry's parameters filled in.
- When access is allowed, `rule` is the first rule that matches, as Medplum picks it, and `hiddenFields` are the fields the member does not see. When it is not, `reason` says why:
  - `no_account`: no active membership in the project.
  - `no_policy`: the membership has no policy Ovok can apply. Medplum would give it every resource, so Ovok never does.
  - `no_matching_rule`: no rule grants the interaction on this resource.
- For a write, Medplum also applies the rule's `writeConstraint` and `readonlyFields` to the resource being written. This check does not run them: read them in `rule`.
- Ovok applies the same decision where it acts for a member, such as who is told of an omni-channel alert.

## Example

```bash
curl -X POST 'https://api.sandbox.ovok.com/v1/access-policies/check' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \
  -H 'Content-Type: application/json' \
  -d '{"person":"Practitioner/PRACTITIONER_ID","resource":"Patient/PATIENT_ID","interaction":"read"}'
```

**Who can call it:** a project admin. See [roles](/access-policies#who-can-call-a-route).