Skip to content

Commit

Permalink
[#2939] create user option linked to api usage for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Oct 11, 2012
1 parent e775cd6 commit 4acb856
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ckan/logic/auth/create.py
Expand Up @@ -91,7 +91,8 @@ def rating_create(context, data_dict):
def user_create(context, data_dict=None):
user = context['user']

if not asbool(config.get('ckan.auth.create_user', False)):
if ('api_version' in context
and not asbool(config.get('ckan.auth.create_user_via_api', False))):
return {'success': False, 'msg': _('User %s not authorized to create users') % user}
else:
return {'success': True}
Expand Down
2 changes: 1 addition & 1 deletion test-core.ini
Expand Up @@ -15,7 +15,7 @@ use = config:development.ini

ckan.auth.user_create_organizations = true
ckan.auth.user_create_groups = true
ckan.auth.create_user = false
ckan.auth.create_user_via_api = false
ckan.auth.create_dataset_if_not_in_organization = true

ckan.cache_validation_enabled = True
Expand Down

0 comments on commit 4acb856

Please sign in to comment.