From 316a668a8e30bc73b310d7e759bab74432b3bdd6 Mon Sep 17 00:00:00 2001 From: Mark Calvert Date: Mon, 20 Dec 2021 17:26:17 +1300 Subject: [PATCH 1/2] Added auth_allow_anonymous_access to auth function fortify_user_update --- ckanext/fortify/logic/auth/update.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ckanext/fortify/logic/auth/update.py b/ckanext/fortify/logic/auth/update.py index 900cab8..be2cbd2 100644 --- a/ckanext/fortify/logic/auth/update.py +++ b/ckanext/fortify/logic/auth/update.py @@ -14,5 +14,6 @@ def fortify_organization_update(next_auth, context, data_dict): @toolkit.chained_auth_function +@toolkit.auth_allow_anonymous_access def fortify_user_update(next_auth, context, data_dict): return helpers.disallow_non_image_uploads(next_auth, context, data_dict) From fd6ff38000ad2c752b3dc11c12e5e5b416412ed7 Mon Sep 17 00:00:00 2001 From: Mark Calvert Date: Mon, 13 Jun 2022 11:27:09 +1200 Subject: [PATCH 2/2] Added missing toolkit abort import --- ckanext/fortify/blueprint.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ckanext/fortify/blueprint.py b/ckanext/fortify/blueprint.py index d07dab9..438a07e 100644 --- a/ckanext/fortify/blueprint.py +++ b/ckanext/fortify/blueprint.py @@ -25,6 +25,7 @@ _ = toolkit._ config = toolkit.config asbool = toolkit.asbool +abort = toolkit.abort fortify = Blueprint(u'fortify', __name__) @@ -134,7 +135,7 @@ def download(package_type, id, resource_id, filename=None): rsc = get_action(u'resource_show')(context, {u'id': resource_id}) get_action(u'package_show')(context, {u'id': id}) except (NotFound, NotAuthorized): - return base.abort(404, _(u'Resource not found')) + return abort(404, _(u'Resource not found')) if rsc.get(u'url_type') == u'upload': upload = uploader.get_resource_uploader(rsc) @@ -148,7 +149,7 @@ def download(package_type, id, resource_id, filename=None): return flask.send_file(filepath) # Fortify updates end elif u'url' not in rsc: - return base.abort(404, _(u'No download is available')) + return abort(404, _(u'No download is available')) return h.redirect_to(rsc[u'url']) fortify.add_url_rule(