Access control lists (ACL)
Access control lists with API constructor
Last updated
Was this helpful?
Access control lists with API constructor
Last updated
Was this helpful?
In Aidbox you can configure Access control lists using .
aidbox.rest.acl
provides a set of operations supporting SQL :filter
s to be added on each request. :filters
can be used to restrict access to resources
aidbox.rest/op-engine
sExpects the same as regular FHIR API engines and also a :filter
aidbox.rest.acl/search
aidbox.rest.acl/create
aidbox.rest.acl/read
aidbox.rest.acl/update
aidbox.rest.acl/conditional-update
aidbox.rest.acl/delete
aidbox.rest.acl/conditional-delete
aidbox.rest.acl/create-with-filter-table-insert
— create resource and create entry in filter table
aidbox.rest.acl/patient-level-bulk-export
aidbox.rest.acl/group-level-bulk-export
An ACL operation requires :filter
to be specified. A filter
requires to define :expression
which will be added to a SQL formed by the operation. :expression
is made of templates
joined with :and
or :or
operators. A filter
optionally accepts :filter-table
aidbox.rest.acl/create-with-filter-table-insert
engine requires :filter-table-insert
property which links operation with the schema tagged with aidbox.rest.acl/filter-table-insert
.
insert-into-filter-table
schema has the following keys:
engine
: currently only aidbox.rest.acl/filter-table-insert-row-sql
is supported
filter-table
: zen symbol defining filter table
values
: values to insert in row. This property value is a map in which keys are column names and values are sql substrings for values.
Filter table defines SQL table to be joined or searched in with SQL templates.
Defines SQL template string. Accepts params. In the template string you can refer to variables with {{<var>}}
syntax. Available variables:
params
can be referred with {{params.<path>.<to>.<param>}}
syntax.
{{filter-table}}
is the :filter-table
added to the filter
{{target-resource}}
is the jsonb of a resource being checked
{{target-id}}
is the id of the resource
Defines a path in a request where to get data. The data can be used in a SQL template
By default, aidbox.rest.acl/create
, aidbox.rest.acl/conditional-update
, aidbox.rest.acl/conditional-delete
engines don't make ACL checks on underlying searches. That can lead to "multiple matches" error even when a user doesn't have access to some resources. Such behavior could be overwritten by acl-checks-on-search?
parameter.
params
: sql parameters. See .