Skip to content

Commit

Permalink
[#1416] add auth function to package_patch action
Browse files Browse the repository at this point in the history
  • Loading branch information
deniszgonjanin authored and wardi committed Oct 27, 2014
1 parent 775a6a6 commit ed4067a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ckan/logic/action/update.py
Expand Up @@ -467,6 +467,8 @@ def package_patch(context, data_dict):
'''

_check_access('package_patch', context, data_dict)

name_or_id = data_dict.get("name") or _get_or_bust(data_dict, "id")
package_dict = _get_action('package_show')(context, {'id': name_or_id})

Expand Down
4 changes: 4 additions & 0 deletions ckan/logic/auth/update.py
Expand Up @@ -48,6 +48,10 @@ def package_update(context, data_dict):

return {'success': True}

@logic.auth_allow_anonymous_access
def package_patch(context, data_dict):
return package_update(context, data_dict)

def package_resource_reorder(context, data_dict):
## the action function runs package update so no need to run it twice
return {'success': True}
Expand Down

0 comments on commit ed4067a

Please sign in to comment.