Git Product home page Git Product logo

ckanext-collaborators's Introduction

ckanext-collaborators

Build Status Coverage Status

This extension adds the ability to assign roles on individual datasets to individual users, alongside the standard organization-based ones.

NOTE: Starting from CKAN 2.9, this feature is built-in into CKAN core

Installation

To install ckanext-collaborators, activate your CKAN virtualenv and run:

git clone https://github.com/okfn/ckanext-collaborators.git
cd ckanext-collaborators
python setup.py develop

Create the database tables running:

paster collaborators init-db -c ../path/to/ini/file

Configuration

Once installed, add the collaborators plugin to the ckan.plugins configuration option on your INI file:

ckan.plugins = ... collaborators

ckanext-collaborators's People

Contributors

amercader avatar chris48s avatar mariorodeghiero avatar pdelboca avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ckanext-collaborators's Issues

Editor collaborator forces change of owner organization on dataset update

Enabling an editor collaborator enables write access to all dataset properties. This includes the owner organization, and if using the web UI the collaborator (who does not belong to the owner org) cannot maintain the dataset's connection to the owner org as it is not an option on the form.

One initial change would be to hide/disable the owner org on the dataset form. I would also argue that changing visibility should be restricted to owner editors as well (perhaps this could be configurable). Limiting access in the API is another matter.

Error after installing over CKAN 2.8

The installation process finishes OK. After adding the plugin in production.ini, when it's necessary to administer a resource, it appears a server error 500. The log says

Error - <type 'exceptions.Exception'>: menu item collaborators.read cannot be found
[Wed Apr 29 02:11:19.696557 2020] [wsgi:error] [pid 20546] [remote 127.0.0.1:51860] File '/usr/lib/ckan/default/lib/python2.7/site-packages/weberror/errormiddleware.py', line 171 in call
[Wed Apr 29 02:11:19.696560 2020] [wsgi:error] [pid 20546] [remote 127.0.0.1:51860] app_iter = self.application(environ, sr_checker)
[Wed Apr 29 02:11:19.696561 2020] [wsgi:error] [pid 20546] [remote 127.0.0.1:51860] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 147 in call
[Wed Apr 29 02:11:19.696563 2020] [wsgi:error] [pid 20546] [remote 127.0.0.1:51860] resp = self.call_func(req, *args, **self.kwargs)
[Wed Apr 29 02:11:19.696564 2020] [wsgi:error] [pid 20546] [remote 127.0.0.1:51860] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
[Wed Apr 29 02:11:19.696565 2020] [wsgi:error] [pid 20546] [remote 127.0.0.1:51860] return self.func(req, *args, **kwargs)
[Wed Apr 29 02:11:19.696567 2020] [wsgi:error] [pid 20546] [remote 127.0.0.1:51860] File '/usr/lib/ckan/default/lib/python2.7/site-packages/fanstatic/publisher.py', line 234 in call
[Wed Apr 29 02:11:19.696568 2020] [wsgi:error] [pid 20546] [remote 127.0.0.1:51860] return request.get_response(self.app)
[Wed Apr 29 02:11:19.696570 2020] [wsgi:error] [pid 20546] [remote 127.0.0.1:51860] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
[Wed Apr 29 02:11:19.696571 2020] [wsgi:error] [pid 20546] [remote 127.0.0.1:51860] application, catch_exc_info=False)
[Wed Apr 29 02:11:19.696572 2020] [wsgi:error] [pid 20546] [remote 127.0.0.1:51860] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
[Wed Apr 29 02:11:19.696574 2020] [wsgi:error] [pid 20546] [remote 127.0.0.1:51860] app_iter = application(self.environ, start_response)
...
Any help will be appreciated.
Emiliano

DB init fails if DB tables already exist

When running:

paster --plugin=ckanext-collaborators collaborators init-db

It will fail if the DB tables already exist. This makes it a bit difficult to use in some deployment scenarios.

It would be great if the script could be idempotent (e.g. continue silently if tables exist) or, we can have a command line option to ignore if tables exist.

As a workaround, we run with || true but this is a poor workaround as it will not crash on other errors.

Error when install with docker-ckan

After install ckannext-collaborators I received this error on the terminal.
Can be related and fix with this Patricio PR #17 ?

Command Runing :

  • docker-compose -f docker-compose.dev.yml up --build

Error:

ckan-dev_1    | 2020-07-03 17:26:23,621 CRITI [ckanext.collaborators.plugin] 
ckan-dev_1    | The dataset collaborators extension requires a database setup. Please run the
ckan-dev_1    | following to create the database tables:
ckan-dev_1    |     paster --plugin=ckanext-collaborators collaborators init-db
ckan-dev_1    | 
solr          | 71795 INFO  (qtp1989972246-14) [   x:ckan] o.a.s.c.S.Request [ckan]  webapp=/solr path=/select params={q=*:*&rows=1&wt=json} hits=20 status=0 QTime=0
solr          | 71804 INFO  (qtp1989972246-21) [   x:ckan] o.a.s.c.S.Request [ckan]  webapp=/solr path=/admin/file params={file=schema.xml} status=0 QTime=0
ckan-dev_1    | 2020-07-03 17:26:23,689 INFO  [ckan.config.environment] Loading templates from /srv/app/src/ckan/ckan/templates
ckan-dev_1    | Traceback (most recent call last):
ckan-dev_1    |   File "/usr/bin/paster", line 11, in <module>
ckan-dev_1    |     load_entry_point('PasteScript==2.0.2', 'console_scripts', 'paster')()
ckan-dev_1    |   File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 102, in run
ckan-dev_1    |     invoke(command, command_name, options, args[1:])
ckan-dev_1    |   File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 141, in invoke
ckan-dev_1    |     exit_code = runner.run(args)
ckan-dev_1    |   File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 236, in run
ckan-dev_1    |     result = self.command()
ckan-dev_1    |   File "/usr/lib/python2.7/site-packages/paste/script/serve.py", line 284, in command
ckan-dev_1    |     relative_to=base, global_conf=vars)
ckan-dev_1    |   File "/usr/lib/python2.7/site-packages/paste/script/serve.py", line 329, in loadapp
ckan-dev_1    |     **kw)
ckan-dev_1    |   File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
ckan-dev_1    |     return loadobj(APP, uri, name=name, **kw)
ckan-dev_1    |   File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
ckan-dev_1    |     return context.create()
ckan-dev_1    |   File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
ckan-dev_1    |     return self.object_type.invoke(self)
ckan-dev_1    |   File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
ckan-dev_1    |     return fix_call(context.object, context.global_conf, **context.local_conf)
ckan-dev_1    |   File "/usr/lib/python2.7/site-packages/paste/deploy/util.py", line 55, in fix_call
ckan-dev_1    |     val = callable(*args, **kw)
ckan-dev_1    |   File "/srv/app/src/ckan/ckan/config/middleware/__init__.py", line 55, in make_app
ckan-dev_1    |     load_environment(conf, app_conf)
ckan-dev_1    |   File "/srv/app/src/ckan/ckan/config/environment.py", line 116, in load_environment
ckan-dev_1    |     p.load_all()
ckan-dev_1    |   File "/srv/app/src/ckan/ckan/plugins/core.py", line 140, in load_all
ckan-dev_1    |     load(*plugins)
ckan-dev_1    |   File "/srv/app/src/ckan/ckan/plugins/core.py", line 168, in load
ckan-dev_1    |     plugins_update()
ckan-dev_1    |   File "/srv/app/src/ckan/ckan/plugins/core.py", line 122, in plugins_update
ckan-dev_1    |     environment.update_config()
ckan-dev_1    |   File "/srv/app/src/ckan/ckan/config/environment.py", line 305, in update_config
ckan-dev_1    |     logic.get_action('get_site_user')({'ignore_auth': True}, None)
ckan-dev_1    |   File "/srv/app/src/ckan/ckan/logic/__init__.py", line 435, in get_action
ckan-dev_1    |     name))
ckan-dev_1    | ckan.logic.NotFound: The action 'package_delete' is not found for chained action
docker-ckan_ckan-dev_1 exited with code 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.