Bugzilla – Attachment 181554 Details for
Bug 39379
The "Edit" button appears in patron search results even when you cannot edit the patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39379: Only display Edit patron button if enough permissions
Bug-39379-Only-display-Edit-patron-button-if-enoug.patch (text/plain), 2.81 KB, created by
Roman Dolny
on 2025-04-25 19:56:41 UTC
(
hide
)
Description:
Bug 39379: Only display Edit patron button if enough permissions
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2025-04-25 19:56:41 UTC
Size:
2.81 KB
patch
obsolete
>From 012936aec5836d3bc1e076d2bded88d09136ac4e Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >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 <tomascohen@theke.io> >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > 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 += '<a href="#" class="btn btn-default btn-xs add_user" data-borrowernumber="' + patron_id + '">' + _("Add") + '</a>'; > [% CASE 'edit' %] >- action_node += '<a href="/cgi-bin/koha/members/memberentry.pl?op=edit_form&destination=circ&borrowernumber=' + patron_id + '" class="btn btn-default btn-xs"><i class="fa-solid fa-pencil" aria-hidden="true"></i> ' + _("Edit") + '</a>'; >+ [% IF CAN_user_borrowers_edit_borrowers %] >+ action_node += '<a href="/cgi-bin/koha/members/memberentry.pl?op=edit_form&destination=circ&borrowernumber=' + patron_id + '" class="btn btn-default btn-xs"><i class="fa-solid fa-pencil" aria-hidden="true"></i> ' + _("Edit") + '</a>'; >+ [% END %] > [% CASE 'checkout' %] > [% IF CAN_user_circulate_circulate_remaining_permissions %] > action_node += '<a class="btn btn-default btn-xs" href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=' + patron_id + '"><i class="fa fa-barcode"></i> ' + _("Check out") + '</a>'; >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39379
:
181436
|
181469
| 181554