This CKAN extension adds a structured dataset approval workflow to CKAN instances that require moderation before datasets become publicly visible. It enhances governance, quality control, and transparency by introducing a controlled review process and providing administrators with clear oversight of dataset publication activities.
The extension is designed to integrate seamlessly with CKAN’s core functionality while adding essential moderation features such as notifications, approval logging, and a dedicated approval stream.
This extension provides three configuration modes for managing the dataset approval workflow:
- Not Active – The approval workflow is disabled and datasets are published immediately.
- Active – The approval workflow is enabled globally for all organizations.
- Activate Approval Workflow per Organization – The workflow can be selectively enabled or disabled at the organization level.
When a user submits a new dataset, it enters an Approval Pending state. At this point:
When submitting a dataset, users see a Review button on the same page used for adding resources. Selecting this option places the dataset into the approval queue.
Organization administrators can view all datasets currently awaiting approval.
Admins and sysadmins can approve or reject the dataset and optionally include notes.
Every approval or rejection event is tracked in the Approval Stream, similar to CKAN’s Activity Stream.
-
Notification is sent — All administrators of the relevant CKAN organization receive an email containing a direct link to the dataset awaiting review.
-
Review actions — Organization administrators or system administrators can either approve or reject the dataset.
-
Publication control —
- Approved datasets move to a published state.
- Rejected datasets are saved as drafts.
-
Approval Stream logging — Every action is recorded with:
- The user who performed the action
- Timestamps for each workflow event
- Optional review notes
This approval flow ensures that dataset publishing follows a consistent, auditable process and gives organizations full control over what becomes publicly accessible.
Note:
Any update made to a dataset by a non-admin user will automatically place the dataset back into the Pending Approval state.
Dataset creations and updates performed by organization administrators or sysadmins are not subject to the approval workflow.
Make sure to have email settings in your ckan.ini file.
Compatibility with core CKAN versions:
| CKAN version | Compatible? |
|---|---|
| 2.9 | Yes |
| 2.10 | Yes |
| 2.11 | Yes |
For CKAN 2.9 use the 0.0.1 tag
To install ckanext-approvalworkflow:
-
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
-
Clone the source and install it on the virtualenv
git clone https://github.com//ckanext-approvalworkflow.gitcd ckanext-approvalworkflowpip install -e .pip install -r requirements.txt -
Add
approvalworkflowto theckan.pluginssetting in your CKAN config file (by default the config file is located at/etc/ckan/default/ckan.ini). -
Create the database tables running:
ckan -c /path/to/ini/file approval_workflow initdb -
If you are using ckanext-datasetversions, make sure to add
datasetversionsplugin afterapprovalworkflowin your CKAN config file -
Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
If your CKAN instance uses additional dataset types defined through ckanext-scheming, beyond the default dataset type, ensure that these custom types are explicitly listed in the configuration. For example:
ckanext.approvalworkflow.dataset_types = report, camel-photos, whitepaper
To install ckanext-approvalworkflow for development, activate your CKAN virtualenv and do:
git clone https://github.com//ckanext-approvalworkflow.git
cd ckanext-approvalworkflow
python setup.py develop
pip install -r dev-requirements.txt
To run the tests, do:
pytest --ckan-ini=test.ini
If ckanext-approvalworkflow should be available on PyPI you can follow these steps to publish a new version:
-
Update the version number in the
setup.pyfile. See PEP 440 for how to choose version numbers. -
Make sure you have the latest version of necessary packages:
pip install --upgrade setuptools wheel twine
-
Create a source and binary distributions of the new version:
python setup.py sdist bdist_wheel && twine check dist/*Fix any errors you get.
-
Upload the source distribution to PyPI:
twine upload dist/* -
Commit any outstanding changes:
git commit -a git push -
Tag the new release of the project on GitHub with the version number from the
setup.pyfile. For example if the version number insetup.pyis 0.0.1 then do:git tag 0.0.1 git push --tags