From fe7c0e503f8357638d01e6f11fbc4256ec703ec2 Mon Sep 17 00:00:00 2001 From: Hayley Mapley Date: Thu, 9 May 2019 10:11:13 +1200 Subject: [PATCH] Bug 22724: (follow-up) Block writeoffs when user has wrong permissions This patch is a followup which displays an alert and removes the submit button when a user who does not have writeoff permissions manages to make it to the 'Make a payment' tab with a writeoff URL. Test plan: 1) Login as a staff user with writeoff permissions disabled, ensure you have sample users, then click the URL: http://localhost:8081/cgi-bin/koha/members/paycollect.pl?borrowernumber=21&type=writeoff&amt=4&selected=1¬es= => Note that you are able to write off the charge with no warning 2) Apply the patch 3) Repeat step 1 => Note that an alert displays and the button to confirm the writeoff has been removed 4) Repeat step 1, this time logging in as a staff user with writeoff permissions enabled => Note that the button displays and you can perform the writeoff Sponsored-by: Catalyst IT --- .../intranet-tmpl/prog/en/modules/members/paycollect.tt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt index 78ee2ed934..b65d0c4d99 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt @@ -131,6 +131,11 @@ [% ELSIF ( writeoff_individual ) %] + + [% IF CAN_user_updatecharges_writeoff %] +

You do not have the permissions required to write off this charge.

+ [% END %] +
@@ -171,12 +176,18 @@
- + [% IF CAN_user_updatecharges_writeoff %] + + [% END %] Cancel
[% ELSE %] + [% IF !CAN_user_updatecharges_writeoff %] +

You do not have the permissions required to write off this charge.

+ [% END %] +
@@ -235,7 +246,9 @@
- + [% IF CAN_user_updatecharges_writeoff %] + + [% END %] Cancel
-- 2.11.0