Organization-based hierarchical access control
Achieve logical multi-tenancy with Aidbox
Last updated
Achieve logical multi-tenancy with Aidbox
Last updated
Hierarchical organization-based access control in Aidbox allows for the restriction of access to data based on the organization to which it belongs. When this feature is enabled, the FHIR Organization resource in Aidbox gains new semantics and functionality.
This means that when users interact with the Organizational FHIR API, they are only able to access the resources that belong to their organization or tenant. The hierarchical organization-based access control ensures that data is logically isolated and accessible only within the appropriate organizational context.
FHIR resources must be separated per organizations. Organizations can be nested. Every organization has access to their own resources and to the nested organization resources.
Let's consider the next organization structure. There are two independent organizations Org A & Org D, each of them has nested, dependent organizations. Org B & Org C are nested to Org A, and Org E is nested to Org D.
To achieve such a behavior, you may consider an Aidbox feature called organization-based access control.
Let's create the organization structure in Aidbox:
When an Organization resource is created, a dedicated FHIR API is deployed for that organization. This API provides access to the associated FHIR resources. Nested organization FHIR resources are accessible through the parent Organization API.
The Organization-based FHIR API base url:
The Organization-based Aidbox API base url:
Let's play with new APIs.
We will create a Patient resource in Org B:
Now we can read it:
Note, that patient has a https://aidbox.app/tenant-organization-id
extension, which references org-b
.
The resource is also accessible through Org A API:
But this resource is not accessible through Org C, Org D and Org E API:
Some Aidbox features do not respect Organization-based access control. The resources managing these features are inaccessible under the Organization API.
For example, there is SubsSubscription
resource.
Any request to the SubsSubscription
resource will return OperationOutcome
with the 422
HTTP code and issue code not-supported
.
If SubsSubscription
resource is created using regular API (not Organization API), Aidbox Subscriptions will send notifications irrespectively of Organization hierarchy.
The default patch method is merge-patch
:
Also, json-patch
is supported.
Using application/json-patch+json
header
Using _method=json-patch
search parameter:
See also Patch
The search API does not support search parameters:
_has
_assoc
_with
Resource full history
Specific version history entry
Supported transaction
and batch
bundle types.
It is also possible to use org-based url in a request.url
:
See also Batch/Transaction
To use $query
endpoint under organization-based hierarchical access control it is necessary to explicitly create organization
param in AidboxQuery
.
Now org-id
is automatically available in the query in {{params.organization}}
.
By default, nested API has no access to a resource that belongs to the upper organizations. Sometimes it is necessary to have resources that can be accessed by the nested APIs. To achieve it the resource should be marked as share
.
Update and delete operations are not allowed from nested organizations' APIs. To update or delete shared
resource use its root organization API.
To create a shared resource, use the https://aidbox.app/tenant-resource-mode
extension.