View | Details | Raw Unified | Return to bug 26346
Collapse All | Expand All

(-)a/Koha/Virtualshelf.pm (-3 / +5 lines)
Lines 186-192 sub add_biblio { Link Here
186
    return if $already_exists;
186
    return if $already_exists;
187
187
188
    # Check permissions
188
    # Check permissions
189
    return unless ( $self->owner == $borrowernumber && $self->allow_change_from_owner ) || ( $self->allow_change_from_staff && Koha::Patrons->find( $borrowernumber )->can_patron_change_staff_only_lists ) || $self->allow_change_from_others;
189
    my $patron = Koha::Patrons->find( $borrowernumber ) or return 0;
190
    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;
190
191
191
    my $content = Koha::Virtualshelfcontent->new(
192
    my $content = Koha::Virtualshelfcontent->new(
192
        {
193
        {
Lines 236-242 sub can_be_deleted { Link Here
236
    return 0 unless $borrowernumber;
237
    return 0 unless $borrowernumber;
237
    return 1 if $self->owner == $borrowernumber;
238
    return 1 if $self->owner == $borrowernumber;
238
239
239
    my $patron = Koha::Patrons->find( $borrowernumber );
240
    my $patron = Koha::Patrons->find( $borrowernumber ) or return 0;
240
241
241
    return 1 if $self->is_public and haspermission( $patron->userid, { lists => 'delete_public_lists' } );
242
    return 1 if $self->is_public and haspermission( $patron->userid, { lists => 'delete_public_lists' } );
242
243
Lines 257-262 sub can_be_managed { Link Here
257
sub can_biblios_be_added {
258
sub can_biblios_be_added {
258
    my ( $self, $borrowernumber ) = @_;
259
    my ( $self, $borrowernumber ) = @_;
259
260
261
    my $patron = Koha::Patrons->find( $borrowernumber ) or return 0;
262
260
    return 1
263
    return 1
261
      if $borrowernumber
264
      if $borrowernumber
262
      and ( ( $self->owner == $borrowernumber && $self->allow_change_from_owner ) or ( $self->allow_change_from_staff && Koha::Patrons->find( $borrowernumber )->can_patron_change_staff_only_lists ) or $self->allow_change_from_others );
265
      and ( ( $self->owner == $borrowernumber && $self->allow_change_from_owner ) or ( $self->allow_change_from_staff && Koha::Patrons->find( $borrowernumber )->can_patron_change_staff_only_lists ) or $self->allow_change_from_others );
263
- 

Return to bug 26346