Skip to content

Commit

Permalink
[#691] Remove fq on legacy search API and force public datasets
Browse files Browse the repository at this point in the history
Even if it is a backwards breaking change we sholdn't be allowing the fq
parameter to be set through the API as it can lead to privacy issues. We
will also enforce that all datasets available through the API are public
(as the v3 API does)
  • Loading branch information
amercader committed Mar 22, 2013
1 parent 818e605 commit e369972
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ckan/controllers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,12 @@ def search(self, ver=None, register=None):
params = search.\
convert_legacy_parameters_to_solr(params)
query = search.query_for(model.Package)

# Remove any existing fq param and set the capacity to
# public
if 'fq' in params:
del params['fq']
params['fq'] = '+capacity:public'
results = query.run(params)
return self._finish_ok(results)
except search.SearchError, e:
Expand Down

0 comments on commit e369972

Please sign in to comment.