Skip to content

Commit

Permalink
[#2037] Fix exception on resource creation
Browse files Browse the repository at this point in the history
The package controller was passing a dataset dict to the auth check for
`resource_create`, instead of a resource one (basically a `package_id`).
  • Loading branch information
amercader committed Mar 3, 2015
1 parent 2666a0a commit c40c171
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ckan/controllers/package.py
Expand Up @@ -707,7 +707,9 @@ def new_resource(self, id, data=None, errors=None, error_summary=None):
except NotFound:
abort(404, _('The dataset {id} could not be found.').format(id=id))
try:
check_access('resource_create', context, pkg_dict)
check_access('resource_create',
context,
{'package_id': pkg_dict['id']})
except NotAuthorized:
abort(401, _('Unauthorized to create a resource for this package'))

Expand Down

0 comments on commit c40c171

Please sign in to comment.