[ckan-dev] Ckan Harvester extension: ckan.logic.NotAuthorized

Adrià Mercader adria.mercader at okfn.org
Tue Aug 13 18:34:30 UTC 2013


Hi David,

There seems to be a regression when using CKAN 2.1 and latest harvest
that prevents the site user from creating sources.

https://github.com/okfn/ckan/issues/1184

I'll have a look asap, in the meantime can you try and create the
source not via the command line but from the frontend with a logged in
user (on http://localhost:5000/harvest/new)?

Sorry about that,

Adrià


On 13 August 2013 18:27, Dave Caraway <dave at fogmine.com> wrote:
> Hi all,
>
> I'm not able to get sources into the ckan harvester. Has anyone seen this
> error before: ckan.logic.NotAuthorized? It has to do with ability to create
> packages. How does one get said permissions? I gave the specified user,
> central, sysadmin rights, but that didn't do the trick.
>
> I'm running with the latest ckanext-harvest code and CKAN's
> origin/release-v2.1 branch, using rabbit mq and solr running in jetty.
>
> Thanks very much in advance!
> -Dave
>
>
> -----------------------
> Command:
> (pyenv) paster --plugin=ckanext-harvest harvester source
> http://test.action.com test-for-action -c
> ~/Dropbox/code/python/development.ini
>
> -----------------------
> Output:
> 2013-08-13 13:13:40,202 DEBUG [ckanext.harvest.model] Harvest tables defined
> in memory
> 2013-08-13 13:13:40,204 DEBUG [ckanext.harvest.model] Harvest tables already
> exist
>
> 2013-08-13 13:13:40,253 INFO  [ckanext.harvest.logic.action.create] Creating
> harvest source: {'user_id': u'', 'url': u'http://test.action.com', 'type':
> u'test-for-action', 'frequency': 'MANUAL', 'publisher_id': u'', 'active':
> True, 'config': None}
> Traceback (most recent call last):
>   File "/home/dwcaraway/pyenv/bin/paster", line 9, in <module>
>     load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
>   File
> "/home/dwcaraway/pyenv/local/lib/python2.7/site-packages/paste/script/command.py",
> line 104, in run
>     invoke(command, command_name, options, args[1:])
>   File
> "/home/dwcaraway/pyenv/local/lib/python2.7/site-packages/paste/script/command.py",
> line 143, in invoke
>     exit_code = runner.run(args)
>   File
> "/home/dwcaraway/pyenv/local/lib/python2.7/site-packages/paste/script/command.py",
> line 238, in run
>     result = self.command()
>   File
> "/home/dwcaraway/Dropbox/code/python/ckan_harvest/ckanext/harvest/commands/harvester.py",
> line 104, in command
>     self.create_harvest_source()
>   File
> "/home/dwcaraway/Dropbox/code/python/ckan_harvest/ckanext/harvest/commands/harvester.py",
> line 202, in create_harvest_source
>     source = get_action('harvest_source_create')(context,data_dict)
>   File
> "/home/dwcaraway/pyenv/local/lib/python2.7/site-packages/ckan-2.1-py2.7.egg/ckan/logic/__init__.py",
> line 329, in wrapped
>     return _action(context, data_dict, **kw)
>   File
> "/home/dwcaraway/Dropbox/code/python/ckan_harvest/ckanext/harvest/logic/action/create.py",
> line 59, in harvest_source_create
>     package_dict = logic.get_action('package_create')(context, data_dict)
>   File
> "/home/dwcaraway/pyenv/local/lib/python2.7/site-packages/ckan-2.1-py2.7.egg/ckan/logic/__init__.py",
> line 329, in wrapped
>     return _action(context, data_dict, **kw)
>   File
> "/home/dwcaraway/pyenv/local/lib/python2.7/site-packages/ckan-2.1-py2.7.egg/ckan/logic/action/create.py",
> line 124, in package_create
>     _check_access('package_create', context, data_dict)
>   File
> "/home/dwcaraway/pyenv/local/lib/python2.7/site-packages/ckan-2.1-py2.7.egg/ckan/logic/__init__.py",
> line 210, in check_access
>     raise NotAuthorized(msg)
> ckan.logic.NotAuthorized: User central not authorized to create packages
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>




More information about the ckan-dev mailing list