From 012936aec5836d3bc1e076d2bded88d09136ac4e Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 24 Apr 2025 17:25:31 -0300 Subject: [PATCH] Bug 39379: Only display Edit patron button if enough permissions This patch adds a check for the current user permissions in order to display the 'Edit' button on the patron search screen. To test: 1. Have a patron with staff access and only `list_borrowers` permission (I picked Henry Acevedo, henry - Acevedo123) 2. Login as that user 3. Perform a patron search at http://kohadev-intra.localhost/cgi-bin/koha/members/members-home.pl => FAIL: There's an 'Edit' button 4. Click on the 'Edit' button => SUCCESS: You are told you don't have enough permissions 5. Apply this patch 6. Repeat 3 => SUCCESS: The button is not displayed 7. Login with a superlibrarian user 8. Repeat 3 => SUCCESS: You can see the button 9. Sign off :-D Signed-off-by: Tomas Cohen Arazi Signed-off-by: Roman Dolny --- koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc index fa8b401a25..85184bdc6a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -747,7 +747,9 @@ [% CASE 'add' %] action_node += '' + _("Add") + ''; [% CASE 'edit' %] - action_node += ' ' + _("Edit") + ''; + [% IF CAN_user_borrowers_edit_borrowers %] + action_node += ' ' + _("Edit") + ''; + [% END %] [% CASE 'checkout' %] [% IF CAN_user_circulate_circulate_remaining_permissions %] action_node += ' ' + _("Check out") + ''; -- 2.39.5