protected_resources is a simple plugin for allowing system administrators the capability to stop deletes from happening.
- When a resource is protected, all users will not be allwed to delete the resource
- A dataset with a protected resource will not be able to be deleted.
- Only a sysadmin can update the protected status of a resource.
- A protected resource can still have it's description/data updated
As of 1.1.0 this extention has been made to work with CKAN 2.9. While attempts have been made to maintain compatibility with prior version of CKAN, there may be issues. If any issues are discovered we are happy to accept PRs. Alternatively for compatibility <2.9 the 1.0.0 tag can be used
- Tested and developed for CKAN 2.9.
To install ckanext-protected_resources:
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Install the ckanext-protected_resources Python package into your virtual environment:
pip install ckanext-protected_resources
Add
protected_resources
to theckan.plugins
setting in your CKAN config file (by default the config file is located at/etc/ckan/default/production.ini
).Add the resource_protected table to your ckan database:
# ckan >= 2.9 ckan -c /PATH_TO_YOUR_INI_FILE/FILENAME.ini protected-resources setup-protected-resources | \ sudo -u postgres pql --set ON_ERROR_STOP=1 # ckan < 2.9 paster --plugin=ckanext-protected_resources admin setup-protected-resources | \ sudo -u postgres pql --set ON_ERROR_STOP=1
Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload