Skip to content

Commit

Permalink
Added decorator auth_sysadmins_check too prevent sysadmin users fro…
Browse files Browse the repository at this point in the history
…m being automatically authorised
  • Loading branch information
MarkCalvert committed Sep 9, 2024
1 parent 865571c commit 80369d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckanext/datarequests/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from ckan import authz
from ckan.plugins.toolkit import current_user, h
from ckan.plugins.toolkit import asbool, auth_allow_anonymous_access, config, get_action
from ckan.plugins.toolkit import asbool, auth_allow_anonymous_access, config, get_action, auth_sysadmins_check

from . import constants, db, request_helpers
from .actions import _dictize_datarequest
Expand Down Expand Up @@ -111,6 +111,7 @@ def delete_datarequest(context, data_dict):
return auth_if_creator(context, data_dict, constants.SHOW_DATAREQUEST)


@auth_sysadmins_check
def close_datarequest(context, data_dict):
# Close data request feature is removed in this project.
return {'success': False}
Expand Down

0 comments on commit 80369d9

Please sign in to comment.