def datastore_make_public(context, data_dict): ''' Allow access to the DataStore table through :meth:`~ckanext.datastore.logic.action.datastore_search_sql`. This action is called automatically when a CKAN dataset becomes public. :param resource_id: if of resource that should become public :type resource_id: string ''' if 'id' in data_dict: data_dict['resource_id'] = data_dict['id'] res_id = _get_or_bust(data_dict, 'resource_id') data_dict['connection_url'] = pylons.config['ckan.datastore.write_url'] if not _resource_exists(context, data_dict): raise p.toolkit.ObjectNotFound(p.toolkit._( 'Resource "{0}" was not found.'.format(res_id) )) data_dict['connection_url'] = pylons.config.get('ckan.datastore.write_url') p.toolkit.check_access('datastore_change_permissions', context, data_dict) db.make_public(context, data_dict)
def datastore_make_public(context, data_dict): ''' Allow access to the DataStore table through :meth:`~ckanext.datastore.logic.action.datastore_search_sql`. This action is called automatically when a CKAN dataset becomes public. :param resource_id: if of resource that should become public :type resource_id: string ''' if 'id' in data_dict: data_dict['resource_id'] = data_dict['id'] res_id = _get_or_bust(data_dict, 'resource_id') if not _resource_exists(context, data_dict): raise p.toolkit.ObjectNotFound( p.toolkit._(u'Resource "{0}" was not found.'.format(res_id))) p.toolkit.check_access('datastore_change_permissions', context, data_dict) db.make_public(context, data_dict)