okfn/ckan — pull request #1184 by amercader (2013-08-16 17:07:03+00:00)
Title: Site user can not create datasets

The site user (a sysadmin named as the site_id, used internally) is not authorized to create datasets.
The `package_create` auth function is wrapped with the `@logic.auth_sysadmins_check` decorator which makes that instead of returning True by default, `is_authorized` will call the auth function even if the user is a sysadmin.

Once in `package_create` auth function, the first check is `new_authz.auth_is_registered_user()` [1], which only checks whether a user is present in the pylons context [2]. As the site user is not there, the check fails.

This causes eg the harvesters not being able to create datasets, or create sources via the command line.

[1] https://github.com/okfn/ckan/blob/master/ckan/logic/auth/create.py#L7
[2] https://github.com/okfn/ckan/blob/master/ckan/new_authz.py#L338