From 1a1ae210f05ba48e1eea4e9f7243e96b3f3e42c6 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 Signed-off-by: Bob Bennhoff - CLiC --- tools/batchMod.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/batchMod.pl b/tools/batchMod.pl index db9c71aa07..8e90e6bfc5 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -191,6 +191,7 @@ if ($op eq "action") { $schema->txn_do( sub { # For each item + my $can_edit = {}; my $i = 1; foreach my $itemnumber (@itemnumbers) { $job->progress($i) if $runinbackground; @@ -198,6 +199,10 @@ if ($op eq "action") { next unless $item ; # Should have been tested earlier, but just in case... + + $can_edit->{ $item->homebranch } //= $patron->can_edit_item( $item->homebranch ); + next unless $can_edit->{ $item->homebranch }; + my $itemdata = $item->unblessed; if ($del) { my $return = $item->safe_delete; -- 2.24.1 (Apple Git-126)