Skip to content

Commit

Permalink
[#2939] New config option
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Nov 15, 2012
1 parent 99ac4d7 commit 893fdd0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ckan/logic/validators.py
Expand Up @@ -19,6 +19,8 @@ def owner_org_validator(key, data, errors, context):
value = data.get(key)

if value is missing or value is None:
if not ckan.new_authz.check_config_permission('create_unowned_dataset'):
raise Invalid('A group must be supplied')
data.pop(key, None)
raise StopOnError

Expand Down
1 change: 1 addition & 0 deletions ckan/new_authz.py
Expand Up @@ -230,6 +230,7 @@ def _get_auth_function(action, profile=None):
# these are prefixed with ckan.auth. in config to override
'anon_create_dataset': False,
'create_dataset_if_not_in_organization': True,
'create_unowned_dataset': True,
'user_create_groups': True,
'user_create_organizations': True,
'create_user_via_api': False,
Expand Down
1 change: 1 addition & 0 deletions ckan/tests/logic/test_auth.py
Expand Up @@ -11,6 +11,7 @@
'user_create_groups': False,
'user_create_organizations': False,
'create_user_via_api': False,
'create_unowned_dataset': False,
}

new_authz.CONFIG_PERMISSIONS.update(INITIAL_TEST_CONFIG_PERMISSIONS)
Expand Down

0 comments on commit 893fdd0

Please sign in to comment.