Medplum AccessPolicy & CareTeam-based Patient Rest...
# support
v
Hi team πŸ‘‹ We’re implementing provider-level access control and wanted to validate our approach. Current state - We have org-level AccessPolicies in place, so users can only access data within their organization. - In the app, we restrict providers to only their CareTeam patients by: -- Fetching CareTeams for the logged-in provider -- Deriving patient IDs -- Loading Patient and patient-linked resources (Observation, CarePlan, Encounter, DocumentReference, etc.) only for those patients This works at the UI level, but we understand this is not a security boundary. Identified limitation AccessPolicy does not support chained or nested criteria (e.g. Patient ← CareTeam), so a provider token can still directly call: GET /fhir/R4/Patient GET /fhir/R4/Observation?subject=Patient/{other-patient} and see all org data. Planned approach We are planning to enforce access server-side by: -- Preventing providers from calling Medplum FHIR APIs directly -- Routing all provider access through our backend -- Using backend/service credentials (systemRepo) to query Medplum -- Enforcing CareTeam β†’ Patient authorization in the backend This ensures providers can only access assigned patients and their data, even via direct API calls. Question Is this *backend enforcement / proxy model * the recommended and supported approach in Medplum for CareTeam-based patient restriction? Are there any other Medplum-supported patterns to achieve this that we should consider? Thanks in advance!
s
Hello @reshma , @cody - please let us know your thoughts on this.
r
@Santosh Chandak - your understanding is correct. It is by design as it is often useful to have access for those who aren't on the care team in case of time off, or for administrative purposes. If you wan't a harder separations, recommend the MSO pattern https://www.medplum.com/docs/access/multi-tenant-access-policy
39 Views