@@ -, +, @@ --- Koha/Virtualshelf.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/Koha/Virtualshelf.pm +++ a/Koha/Virtualshelf.pm @@ -187,7 +187,7 @@ sub add_biblio { # Check permissions my $patron = Koha::Patrons->find( $borrowernumber ) or return 0; - return unless ( $self->owner == $borrowernumber && $self->allow_change_from_owner ) || ( $self->allow_change_from_staff && $patron->can_patron_change_staff_only_lists ) || $self->allow_change_from_others; + return 0 unless ( $self->owner == $borrowernumber && $self->allow_change_from_owner ) || ( $self->allow_change_from_staff && $patron->can_patron_change_staff_only_lists ) || $self->allow_change_from_others; my $content = Koha::Virtualshelfcontent->new( { @@ -238,7 +238,7 @@ sub can_be_deleted { return 0 unless $borrowernumber; return 1 if $self->owner == $borrowernumber; - my $patron = Koha::Patrons->find( $borrowernumber ); + my $patron = Koha::Patrons->find( $borrowernumber ) or return 0; return 1 if $self->is_public and haspermission( $patron->userid, { lists => 'delete_public_lists' } ); @@ -260,6 +260,7 @@ sub can_biblios_be_added { my ( $self, $borrowernumber ) = @_; my $patron = Koha::Patrons->find( $borrowernumber ) or return 0; + return 1 if $borrowernumber and ( ( $self->owner == $borrowernumber && $self->allow_change_from_owner ) or ( $self->allow_change_from_staff && $patron->can_patron_change_staff_only_lists ) or $self->allow_change_from_others ); --