How to enable hierarchical access control
This guide explains how multi-tenancy on the Organization resources can be enabled
Prerequisites
Docker and Docker Compose
You should have Docker and Docker Compose installed before go further. To get it installed follow the instructions.
Aidbox license
To get the Aidbox License:
Go the Aidbox user portal https://aidbox.app
Login to the portal
Create new self-hosted Aidbox License or use the license that you already have
Create Aidbox project
Aidbox is configured by the Aidbox Configuration Project. To create sample project run command below.
Note that to use hierarchical access control with the FHIR Schema validator, you need to clone the orgbac-with-fhir-schema
branch, which has the FHIR Schema validator enabled and the Aidbox Configuration Project configured.
Apply the license
Populate the .env
file with the Aidbox License.
Enable multi-tenancy
To enable hierarchical access control (multi-tenancy on Organization resources) ensure that necessary imports are present in zrc/main.edn
file.
Add aidbox.multitenancy.v1.fhir-r4
to the import section.
Start Aidbox with Docker Compose
To start Aidbox run the command in the aidbox-project
directory.
When Aidbox starts, navigate to the http://localhost:8888 and sign in to the Aidbox UI using the credentials admin
/ password
.
Ensure the hierarchical access control works
Create nested Organization resources
Use Aidbox UI Rest Console to create nested Organization resources.
Root organization
Child organization
Grant-child organization
You should have 3 nested organizations for now
Create resource in the Organization B
Use Aidbox UI Rest Console to create Patient resource in the organization B.
Check access control works
Patient is visible from the Organization above (org-a)
Patient is visible from its Organization (org-b)
Patient is not visible from the nested Organization (org-c)
Configuring AccessPolicies
To allow some user/client to interact with a organization-based resources, AccessPolicy should be configured to check organization id from the https://aidbox.app/tenant-organization-id
extension of User/Client resource.
This example allows org-based user (created by PUT /Organization/<org-id>/fhir/User
) to see patients that are also created by OrgBAC.
Last updated