Skip to content

Commit

Permalink
[#2939] Bugfix in package relationship list
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Oct 10, 2012
1 parent 910f4b0 commit 6a559bd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ckan/logic/auth/get.py
Expand Up @@ -80,10 +80,13 @@ def package_relationships_list(context, data_dict):
# If we can see each package we can see the relationships
authorized1 = new_authz.is_authorized_boolean(
'package_show', context, {'id': id})
authorized2 = new_authz.is_authorized_boolean(
'package_show', context, {'id': id2})
if id2:
authorized2 = new_authz.is_authorized_boolean(
'package_show', context, {'id': id2})
else:
authorized2 = True

if not authorized1 and authorized2:
if not (authorized1 and authorized2):
return {'success': False, 'msg': _('User %s not authorized to read these packages') % user}
else:
return {'success': True}
Expand Down

0 comments on commit 6a559bd

Please sign in to comment.