Skip to content

Commit

Permalink
Add auth functions for new logic functions
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelbabu committed Nov 27, 2013
1 parent f93c0c6 commit 36e3155
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ckan/logic/action/get.py
Expand Up @@ -1027,8 +1027,6 @@ def _group_or_org_package_show(context, data_dict, is_org=True):
if not is_org and group.is_organization:
raise NotFound

_check_access('group_show', context, data_dict)

result = []
for pkg_rev in group.packages(limit=limit,
return_query=context.get('return_query')):
Expand All @@ -1048,6 +1046,8 @@ def group_package_show(context, data_dict):
:rtype: list of dictionaries
'''
_check_access('group_package_show', context, data_dict)

return _group_or_org_package_show(context, data_dict, is_org=False)


Expand All @@ -1062,6 +1062,8 @@ def organization_package_show(context, data_dict):
:rtype: list of dictionaries
'''
_check_access('organization_package_show', context, data_dict)

return _group_or_org_package_show(context, data_dict, is_org=True)


Expand Down
6 changes: 6 additions & 0 deletions ckan/logic/auth/get.py
Expand Up @@ -147,10 +147,16 @@ def group_show(context, data_dict):
# anyone can see a group
return {'success': True}

def group_package_show(context, data_dict):
return {'success': True}

def organization_show(context, data_dict):
# anyone can see a organization
return {'success': True}

def organization_package_show(context, data_dict):
return {'success': True}

def tag_show(context, data_dict):
# No authz check in the logic function
return {'success': True}
Expand Down

0 comments on commit 36e3155

Please sign in to comment.