A CKAN extension that allows organisation members to create datasets, and edit or delete the datasets they have created.
This extension changes the permissions of users with the ‘Member’ role in an organisation, allowing them to create datasets, and to edit or delete the datasets they have created. Unlike users with the ‘Editor’ role, they cannot edit or delete datasets created by other users.
Notes:
Warning: This plugin modifies CKAN’s permission system. The current implementation cannot be considered fully safe and should only be used AT YOUR OWN RISK in a trusted environment. Ensure you run the tests with your plugins enabled.
Path variables used below:
$INSTALL_FOLDER
(i.e. where CKAN is installed), e.g.
/usr/lib/ckan/default
$CONFIG_FILE
, e.g. /etc/ckan/default/development.ini
src
folder:cd $INSTALL_FOLDER/src
git clone https://github.com/NaturalHistoryMuseum/ckanext-userdatasets.git
. $INSTALL_FOLDER/bin/activate
cd $INSTALL_FOLDER/src/ckanext-userdatasets
pip install -r requirements.txt
cd $INSTALL_FOLDER/src/ckanext-userdatasets
python setup.py develop
$CONFIG_FILE
:ckan.plugins = ... userdatasets
There are no configuration options for this extension.
No new actions are defined in this extension; three are overridden to modify validators and permissions.
package_create
package_update
organization_list_for_user
Test coverage is currently extremely limited.
To run the tests in this extension, there is a Docker compose configuration available in this repository to make it easy.
To run the tests against ckan 2.9.x on Python3:
docker-compose build
docker-compose run ckan
The ckan image uses the Dockerfile in the docker/
folder which is
based on openknowledge/ckan-dev:2.9
.
Note that currently the tests mock the Datacite API and therefore don’t require an internet connection nor your Datacite credentials to run.