Bugzilla – Attachment 125436 Details for
Bug 26346
Add option to make a public list editable by library staff only
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26346: (follow-up) Fixes in response to QA
Bug-26346-follow-up-Fixes-in-response-to-QA.patch (text/plain), 2.16 KB, created by
Alex Buckley
on 2021-09-28 21:05:10 UTC
(
hide
)
Description:
Bug 26346: (follow-up) Fixes in response to QA
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2021-09-28 21:05:10 UTC
Size:
2.16 KB
patch
obsolete
>From fa052b7bdd24c7b9234d7c3a036e8d9a9d78d1f1 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Sat, 14 Aug 2021 06:54:45 +0000 >Subject: [PATCH] Bug 26346: (follow-up) Fixes in response to QA > >* Fix addressing comment #59 - Making can_be_deleted() consistent to >testing Patrons::find > >* Fix addressing comment comment #61 - Have made the first and second >lines consistent, both now return 0 > >Sponsord-By: Catalyst IT >--- > Koha/Virtualshelf.pm | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > >diff --git a/Koha/Virtualshelf.pm b/Koha/Virtualshelf.pm >index 1400bbdcc8..6707f1bf44 100644 >--- a/Koha/Virtualshelf.pm >+++ b/Koha/Virtualshelf.pm >@@ -186,7 +186,8 @@ sub add_biblio { > return if $already_exists; > > # Check permissions >- 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; >+ my $patron = Koha::Patrons->find( $borrowernumber ) or return 0; >+ 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( > { >@@ -236,7 +237,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' } ); > >@@ -257,6 +258,8 @@ sub can_be_managed { > 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 && Koha::Patrons->find( $borrowernumber )->can_patron_change_staff_only_lists ) or $self->allow_change_from_others ); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26346
:
119686
|
120663
|
120664
|
120665
|
120909
|
120910
|
120953
|
120954
|
121511
|
121512
|
122033
|
122034
|
122533
|
122535
|
122536
|
122537
|
122538
|
122539
|
122540
|
122685
|
122686
|
122687
|
122688
|
122689
|
122691
|
124010
|
124011
|
125436
|
125472
|
125914
|
125915
|
125916
|
125917
|
127556
|
127557
|
127558
|
127559
|
127560
|
128017
|
128018
|
128019
|
128020
|
128021
|
128022
|
128023
|
128383
|
128384
|
128385
|
131699
|
131700
|
131757
|
131764
|
132373
|
132475
|
132476
|
132477
|
132478
|
132479
|
132751
|
132752
|
132753
|
132754
|
132755