Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 2.03 KB

README.rst

File metadata and controls

61 lines (41 loc) · 2.03 KB

ckanext-protected_resources

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

CKAN < 2.9 support

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

Requirements

  1. Tested and developed for CKAN 2.9.

Installation

To install ckanext-protected_resources:

  1. Activate your CKAN virtual environment, for example:

    . /usr/lib/ckan/default/bin/activate
    
  2. Install the ckanext-protected_resources Python package into your virtual environment:

    pip install ckanext-protected_resources
    
  3. Add protected_resources to the ckan.plugins setting in your CKAN config file (by default the config file is located at /etc/ckan/default/production.ini).

  4. 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
    
  5. Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:

    sudo service apache2 reload