Organization masking for the City of Malmö CKAN instance.
This extension is designed to mask the original organizations of datasets and expose them all as being owned by a single organization: Malmö Stad (slug: malmo).
This is achieved by intercepting the dataset data at the controller level, ensuring that both the Web UI and the API (package_show, package_search) report the masked organization.
- Organization Masking: Intercepts
IPackageControllerhooks to replace theorganizationdictionary in dataset responses. - API Support: Impacts
package_showandpackage_searchactions. - DCAT Integration: Since it modifies the data dictionary, DCAT exports (via
ckanext-dcat) also reflect the masked organization automatically.
- CKAN 2.10+ (tested on 2.11)
To install ckanext-malmo:
- Clone this repository (or copy the extension files).
- Install the extension in your environment:
pip install -e ckan/extensions/ckanext-malmo
- Add
malmoto theckan.pluginssetting in your CKAN configuration file (ckan.ini):ckan.plugins = ... malmo
The extension uses the following defaults (hardcoded in plugin.py for robustness):
- Organization Slug:
malmo - Organization Title:
Malmö Stad
Note: The organization malmo must exist in the CKAN database for links and relationships to resolve correctly. The project's prerun.py script is updated to create this organization automatically during startup.