Skip to content

Commit

Permalink
[#2939] Auth create user_create() changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Oct 10, 2012
1 parent 38f33ea commit bccae61
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ckan/logic/auth/create.py
Expand Up @@ -90,12 +90,10 @@ def rating_create(context, data_dict):
return {'success': True}

def user_create(context, data_dict=None):
model = context['model']
user = context['user']

authorized = logic.check_access_old(model.System(), model.Action.USER_CREATE, context)
if not authorized:
return {'success': False, 'msg': _('User %s not authorized to create users') % str(user)}
if not asbool(config.get('ckan.auth.create_user', True)):
return {'success': False, 'msg': _('User %s not authorized to create users') % user}
else:
return {'success': True}

Expand Down

0 comments on commit bccae61

Please sign in to comment.