Skip to content

Commit

Permalink
[#2939] Auth update revision_change_state() changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Oct 10, 2012
1 parent 75323df commit cfb0097
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ckan/logic/auth/update.py
Expand Up @@ -136,14 +136,10 @@ def user_update(context, data_dict):
return {'success': True}

def revision_change_state(context, data_dict):
model = context['model']
# FIXME currently only sysadmins can change state
user = context['user']

authorized = Authorizer().is_authorized(user, model.Action.CHANGE_STATE, model.Revision)
if not authorized:
return {'success': False, 'msg': _('User %s not authorized to change state of revision' ) % str(user)}
else:
return {'success': True}
return {'success': False, 'msg': _('User %s not authorized to change state of revision' ) % user}

def task_status_update(context, data_dict):
# sysadmins only
Expand Down

0 comments on commit cfb0097

Please sign in to comment.