- Notifications
You must be signed in to change notification settings - Fork1
CKAN extension to allow admin/editor users to assign datasets to any CKAN group.
License
salsadigitalauorg/ckanext-package-group-permissions
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A CKAN extension to allow any user with admin or editor role in an organisation to assign datasets in their organisation to any group in CKAN.
This extension has been tested with CKAN v2.8.3 & v2.9.2.
While not tested with v2.7.0+ - the required permission was changed from 'update' to 'manage_group' in v2.7.0, so thisshould work in v2.7.0+.
We wanted the ability for any user with admin or editor role in an organisation to be able to assign datasets in their organisation to any group in CKAN.
Previously, this was handled manually, i.e. each admin/editor user was assigned as an admin of each group in CKAN by adding them via the API. This process was very time consuming as the number of admins/editors and groups increased.
We tried implementing the suggestions outlined in this Stack Overflow question:https://stackoverflow.com/questions/37279610/ckan-package-group-permissions - however we were unable to get it working as desired.
Our solution ended up being a little simpler for our requirements:
The overridden function is largely based on thecore CKANmember_create
function, with an additional check to see if the user is an admin or editor of the organisation that owns the dataset.
This solution also requires some CKAN templates to be overridden:
templates/package/group_list.html
Overridden to displayall groups to the userif the user haspackage_update
permission for the dataset.
If the user does not havepackage_update
permission - it falls back to the CKAN default of displaying only the groups that user is assigned to.
templates/group/snippets/group_item.html
Overridden to display thedelete button on a group assigned to the dataset if the user hasmember_delete
permission for the group.
This also supports the default CKAN behaviour to display the delete button on any groups that user is assigned to.
Clone this repository into your CKAN extensions directory, e.g.
/usr/lib/ckan/default/src
Activate your virtualenv and run the
setup.py
, e.g.. /usr/lib/ckan/default/bin/activate cd ckanext-package-group-permissions python setup.py develop
Add
package_group_permissions
tockan.plugins
in your CKAN.ini
file, e.g.ckan.plugins = ... package_group_permissions
Restart Apache/Nginx/UWSGI
About
CKAN extension to allow admin/editor users to assign datasets to any CKAN group.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.