Skip to content

Commit

Permalink
[1669] Allow ignore_auth to be specified in context for package_show
Browse files Browse the repository at this point in the history
  • Loading branch information
rossjones committed Feb 13, 2012
1 parent 73f2b02 commit d3cd286
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ckan/logic/auth/publisher/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ def package_show(context, data_dict):
package = get_package_object(context, data_dict)

if package.state == 'deleted':
if 'ignore_auth' in context and context['ignore_auth']:
return {'success': True}

user = context.get('user')

if not user:
Expand Down
3 changes: 3 additions & 0 deletions ckan/logic/auth/publisher/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ def package_update(context, data_dict):
user = context.get('user')
package = get_package_object(context, data_dict)

if Authorizer().is_sysadmin(unicode(user)):
return { 'success': True }

userobj = model.User.get( user )
if not userobj or \
not _groups_intersect( userobj.get_groups('publisher'), package.get_groups('publisher') ):
Expand Down

0 comments on commit d3cd286

Please sign in to comment.