From f4ae93e5a9324ebe127ff8ae40bd656960553132 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 08dc6f5138..9635774d89 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -183,13 +183,19 @@ if ($op eq "action") { } # For each item + my $can_edit = {}; my $i = 1; foreach my $itemnumber(@itemnumbers){ $job->progress($i) if $runinbackground; + my $item = Koha::Items->find($itemnumber); next unless $item; # Should have been tested earlier, but just in case... my $itemdata = $item->unblessed; + + $can_edit->{ $item->homebranch } //= $patron->can_edit_item( $item->homebranch ); + next unless $can_edit->{ $item->homebranch }; + if ( $del ){ my $return = $item->safe_delete; if (ref($return)) { -- 2.24.1 (Apple Git-126)