Policy Access Control#
Warning
Policy Access Control applies only to piveau-hub-search.
To see how hub-search implements access control, read the access control README.
Policy access control lets you limit who can find and read datasets and custom resources in hub-search by defining an Open Digital Rights Language (ODRL) policy in your metadata. For example, a policy can allow access only to users from Germany or deny access to users from specific organizations. Therefore, you should have a basic understanding about ODRL to work with this feature.
What endpoints are protected?#
When hub-search receives a request, it checks the users' access token, such as the country or organization sector, against the policy to decide whether to allow or deny access.
Policy access control applies to the following GET endpoints in hub-search.
| Endpoint | What happens when access is denied |
|---|---|
GET /search |
The dataset or custom resource is omitted from the results. |
GET /datasets?catalogue={catalogueId} |
The dataset ID is omitted from the catalogue’s dataset list. |
GET /datasets/{id} |
Hub-search returns 403 Forbidden. |
GET /resources/{resourceType} |
The custom resource ID is omitted from the list. |
GET /resources/{resourceType}/{id} |
Hub-search returns 403 Forbidden. |
GET /ckan/package_list and GET /ckan/package_search |
The dataset is omitted from CKAN results. |
GET /ckan/package_show?id={id} |
Hub-search returns 403 Forbidden. |
GET /{lang}/feeds/datasets.atom and GET /{lang}/feeds/datasets.rss |
The dataset is omitted from the feed. |
Note: Hub-repo endpoints are NOT protected by policy access control.
Limitations#
- Endpoints. Policy access control applies to the hub-search requests listed under What endpoints are protected?.
- Permissions. Hub-search checks only ODRL
odrl:readpermissions. Every constraint in eachodrl:readpermission must pass. If the policy has a singleodrl:readpermission with no constraints, any signed-in user can read the dataset. - Operators. Hub-search supports two constraint operators. With
odrl:isAnyOf, at least one token value must match a value in the policy. Withodrl:isNoneOf, none of the token values may match an excluded value.
Further Reading#
- Read how to configure Policy Access Control and see examples here.