From 79eb9db0064c43af74873d0a699dc15dde084afc Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Fri, 30 Apr 2021 05:00:58 +0000 Subject: [PATCH] Bug 26346: Add option to Remove items from list Test plan: 1. Follow the test plans in the previous two patches 2. Create a public list with 'Allow changes to contents from'='Staff only' 3. Login to the staff client as a different user 4. Add items to the list 5. Remove items from the list 6. Confirm items were removed 7. Log into the OPAC as the same user as step 3 8. Remove items from the list Sponsored-by: Horowhenua Library Trust, New Zealand --- Koha/Virtualshelf.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Koha/Virtualshelf.pm b/Koha/Virtualshelf.pm index 6104912de0..56ffe42d74 100644 --- a/Koha/Virtualshelf.pm +++ b/Koha/Virtualshelf.pm @@ -209,8 +209,11 @@ sub remove_biblios { my $borrowernumber = $params->{borrowernumber}; return unless @$biblionumbers; + my $patron = Koha::Patrons->find( $borrowernumber ); + my $staffuser = 1 if ( haspermission( $patron->userid, {'catalogue' => 1 })); my $number_removed = 0; if( ( $self->owner == $borrowernumber && $self->allow_change_from_owner ) + || ( $staffuser && $self->allow_change_from_staff ) || $self->allow_change_from_others ) { $number_removed += $self->get_contents->search({ biblionumber => $biblionumbers, -- 2.11.0