From 014de33c4c338df66e23c27869c7d203f1f823a6 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 4 Dec 2019 13:33:47 -0500 Subject: [PATCH] Bug 20256: (QA follow-up) Skip batch editing items the user is not allowed to edit --- tools/batchMod.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 04db7a9745..46a79fbb31 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -179,6 +179,7 @@ if ($op eq "action") { } # For each item + my $can_edit = {}; my $i = 1; foreach my $itemnumber(@itemnumbers){ @@ -186,6 +187,10 @@ if ($op eq "action") { my $itemdata = Koha::Items->find($itemnumber); next unless $itemdata; # Should have been tested earlier, but just in case... $itemdata = $itemdata->unblessed; + + $can_edit->{ $itemdata->{homebranch} } //= $patron->can_edit_item( $itemdata->{homebranch} ); + next unless $can_edit->{ $itemdata->homebranch }; + if ( $del ){ my $return = DelItemCheck( $itemdata->{'biblionumber'}, $itemdata->{'itemnumber'}); if ($return == 1) { -- 2.21.0 (Apple Git-122.2)