Skip to content

Commit

Permalink
[#2939] Add .ini option for anon dataset creation
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Oct 11, 2012
1 parent ad2eb8d commit cf905d0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ckan/logic/auth/create.py
@@ -1,4 +1,4 @@
from pylons import config
from pylons import config, c
from pylons.i18n import _
from paste.deploy.converters import asbool

Expand All @@ -8,7 +8,10 @@

def package_create(context, data_dict=None):
user = context['user']
check1 = asbool(config.get('ckan.auth.create_dataset_if_not_in_organization', False)) \
if not c.user:
check1 = config.get('ckan.auth.anon_create_dataset', False)
else:
check1 = asbool(config.get('ckan.auth.create_dataset_if_not_in_organization', False)) \
or new_authz.has_user_permission_for_some_org(user, 'create_dataset')

if not check1:
Expand Down

0 comments on commit cf905d0

Please sign in to comment.