Bugzilla – Attachment 183058 Details for
Bug 33440
A public list can be transferred to a staff member without list permissions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33440: Added permission requirements to unauthorized_transfer
Bug-33440-Added-permission-requirements-to-unautho.patch (text/plain), 1.33 KB, created by
Baptiste Wojtkowski (bwoj)
on 2025-06-06 08:48:19 UTC
(
hide
)
Description:
Bug 33440: Added permission requirements to unauthorized_transfer
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2025-06-06 08:48:19 UTC
Size:
1.33 KB
patch
obsolete
>From 2076d75266009fda6302764a8d0ac8fc316fc179 Mon Sep 17 00:00:00 2001 >From: Laura_Escamilla <laura.escamilla@bywatersolutions.com> >Date: Tue, 22 Apr 2025 15:57:22 +0000 >Subject: [PATCH] Bug 33440: Added permission requirements to > unauthorized_transfer > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >--- > Koha/Virtualshelf.pm | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > >diff --git a/Koha/Virtualshelf.pm b/Koha/Virtualshelf.pm >index b912aba4..77733e97 100644 >--- a/Koha/Virtualshelf.pm >+++ b/Koha/Virtualshelf.pm >@@ -439,6 +439,19 @@ sub cannot_be_transferred { > if ( !Koha::Patrons->find($to) ) { > return 'new_owner_not_found'; > } >+ my $to_patron = Koha::Patrons->find($to); >+ >+ if ( $self->public ) { >+ return 'unauthorized_transfer' >+ unless C4::Auth::haspermission( >+ $to_patron->userid, >+ { >+ lists => [ >+ 'create_public_lists', 'delete_public_lists', 'edit_public_list_contents', 'edit_public_lists' >+ ] >+ } >+ ); >+ } > if ( !$self->public && !$shares->search( { borrowernumber => $to } )->count ) { > return 'new_owner_has_no_share'; > } >-- >2.30.2
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 33440
:
181299
|
181300
|
181301
|
181302
|
181315
|
181316
|
181317
|
181318
| 183058 |
183059
|
183060
|
183061