From: Alex Sadleir Date: Tue, 24 Sep 2013 01:54:51 +0000 Subject: Allow anonymous access to datastore API search X-Git-Url: https://maxious.lambdacomplex.org/git/?p=ckanext-datagovau.git&a=commitdiff&h=6d4c0830661e5d06a7e2d818491b99a469d52fee --- Allow anonymous access to datastore API search --- --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,24 +5,34 @@ - + + + + + + + + + - - - - - - - + + + + + + + - - + + - + + + - - - - - - - - - - + @@ -104,16 +105,70 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -138,21 +193,22 @@ @@ -296,6 +352,10 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + --- a/ckanext/datagovau/plugin.py +++ b/ckanext/datagovau/plugin.py @@ -27,7 +27,7 @@ return created_datasets_list + active_datasets_list -class ExampleIDatasetFormPlugin(plugins.SingletonPlugin, +class DataGovAuPlugin(plugins.SingletonPlugin, tk.DefaultDatasetForm): '''An example IDatasetForm CKAN plugin. @@ -37,17 +37,13 @@ plugins.implements(plugins.IConfigurer, inherit=False) plugins.implements(plugins.IDatasetForm, inherit=False) plugins.implements(plugins.ITemplateHelpers, inherit=False) + plugins.implements(plugins.IAuthFunctions) - # These record how many times methods that this plugin's methods are - # called, for testing purposes. - num_times_new_template_called = 0 - num_times_read_template_called = 0 - num_times_edit_template_called = 0 - num_times_search_template_called = 0 - num_times_history_template_called = 0 - num_times_package_form_called = 0 - num_times_check_data_dict_called = 0 - num_times_setup_template_variables_called = 0 + def datastore_search(context, data_dict): + return {'success': True} # allow all + + def get_auth_functions(self): + return {'datastore_search': datastore_search} def update_config(self, config): --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ entry_points=\ """ [ckan.plugins] - datagovau=ckanext.datagovau.plugin:ExampleIDatasetFormPlugin + datagovau=ckanext.datagovau.plugin:DataGovAuPlugin """, )