From 018b84127ce964c938dab039ec8273e3284a75d4 Mon Sep 17 00:00:00 2001 From: fdelavega Date: Wed, 26 Apr 2017 16:52:53 +0200 Subject: [PATCH] Fix problem with renamed revoked_access action --- ckanext/privatedatasets/actions.py | 2 +- ckanext/privatedatasets/auth.py | 5 +++-- ckanext/privatedatasets/plugin.py | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ckanext/privatedatasets/actions.py b/ckanext/privatedatasets/actions.py index 25eb38e..fea1461 100644 --- a/ckanext/privatedatasets/actions.py +++ b/ckanext/privatedatasets/actions.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2014 CoNWeT Lab., Universidad Politécnica de Madrid +# Copyright (c) 2014 - 2017 CoNWeT Lab., Universidad Politécnica de Madrid # This file is part of CKAN Private Dataset Extension. diff --git a/ckanext/privatedatasets/auth.py b/ckanext/privatedatasets/auth.py index c14ddfb..cb2c5c1 100644 --- a/ckanext/privatedatasets/auth.py +++ b/ckanext/privatedatasets/auth.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2014 CoNWeT Lab., Universidad Politécnica de Madrid +# Copyright (c) 2014 - 2017 CoNWeT Lab., Universidad Politécnica de Madrid # This file is part of CKAN Private Dataset Extension. @@ -141,6 +141,7 @@ def acquisitions_list(context, data_dict): # Users can get only their acquisitions list return {'success': context['user'] == data_dict['user']} -def package_deleted(context, data_dict): +@tk.auth_allow_anonymous_access +def revoke_access(context, data_dict): # TODO: Check functionality and improve security(if needed) return {'success': True} \ No newline at end of file diff --git a/ckanext/privatedatasets/plugin.py b/ckanext/privatedatasets/plugin.py index dd5f231..4d9bab1 100755 --- a/ckanext/privatedatasets/plugin.py +++ b/ckanext/privatedatasets/plugin.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2014 CoNWeT Lab., Universidad Politécnica de Madrid +# Copyright (c) 2014 - 2017 CoNWeT Lab., Universidad Politécnica de Madrid # This file is part of CKAN Private Dataset Extension. @@ -113,7 +113,7 @@ class PrivateDatasets(p.SingletonPlugin, tk.DefaultDatasetForm): # 'resource_show': auth.resource_show, constants.PACKAGE_ACQUIRED: auth.package_acquired, constants.ACQUISITIONS_LIST: auth.acquisitions_list, - constants.PACKAGE_DELETED: auth.package_deleted} + constants.PACKAGE_DELETED: auth.revoke_access} # resource_show is not required in CKAN 2.3 because it delegates to # package_show @@ -156,7 +156,7 @@ class PrivateDatasets(p.SingletonPlugin, tk.DefaultDatasetForm): return { constants.PACKAGE_ACQUIRED: actions.package_acquired, constants.ACQUISITIONS_LIST: actions.acquisitions_list, - constants.PACKAGE_DELETED: actions.package_deleted + constants.PACKAGE_DELETED: actions.revoke_access } ######################################################################