Skip to content

Commit

Permalink
[#652] Make private resources compatible with legacy mode
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Apr 24, 2013
1 parent 43c578e commit eb06a95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ckanext/datastore/logic/action.py
Expand Up @@ -73,7 +73,8 @@ def datastore_create(context, data_dict):

# create a private datastore resource, if necessary
resource = model.Resource.get(res_id)
if resource.resource_group.package.private:
legacy_mode = 'ckan.datastore.read_url' not in pylons.config
if not legacy_mode and resource.resource_group.package.private:
data_dict['private'] = True

result = db.create(context, data_dict)
Expand Down
9 changes: 5 additions & 4 deletions ckanext/datastore/plugin.py
Expand Up @@ -222,11 +222,12 @@ def get_actions(self):
actions = {'datastore_create': action.datastore_create,
'datastore_upsert': action.datastore_upsert,
'datastore_delete': action.datastore_delete,
'datastore_search': action.datastore_search,
'datastore_make_private': action.datastore_make_private,
'datastore_make_public': action.datastore_make_public}
'datastore_search': action.datastore_search}
if not self.legacy_mode:
actions['datastore_search_sql'] = action.datastore_search_sql
actions.update({
'datastore_search_sql': action.datastore_search_sql,
'datastore_make_private': action.datastore_make_private,
'datastore_make_public': action.datastore_make_public})
return actions

def get_auth_functions(self):
Expand Down

0 comments on commit eb06a95

Please sign in to comment.