Bugzilla – Attachment 181302 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: Tests
Bug-33440-Tests.patch (text/plain), 2.86 KB, created by
Laura Escamilla
on 2025-04-22 16:36:32 UTC
(
hide
)
Description:
Bug 33440: Tests
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2025-04-22 16:36:32 UTC
Size:
2.86 KB
patch
obsolete
>From af5bbed8d12b5648ee4699892f4e436e4be5cc8e Mon Sep 17 00:00:00 2001 >From: Laura_Escamilla <laura.escamilla@bywatersolutions.com> >Date: Tue, 22 Apr 2025 16:27:50 +0000 >Subject: [PATCH] Bug 33440: Tests >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Test Plan >1. Staff member A creates a public list. >2. Staff member A transfers this public list to another staff member (staff member b) without list permissions. >3. Staff Member B now has the ability to edit this public list and add/remove items from this list. >4. Apply the patch >5. Repeat steps 1 and 2. An error message should now appear stating that the âTransfer not allowed: You or the selected user do not have the required permissions.â >6. Provide the correct permissions to Staff Member B. Initiate the transfer again. The transfer should be successful. >7. Test these steps in the OPAC as well. >8. Prove t/db_dependent/Virtualshelves.t >9. Sign off and have a wonderful day! :D >--- > t/db_dependent/Virtualshelves.t | 26 +++++++++++++++++++++++--- > 1 file changed, 23 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Virtualshelves.t b/t/db_dependent/Virtualshelves.t >index 1df952df22..10182dfbc5 100755 >--- a/t/db_dependent/Virtualshelves.t >+++ b/t/db_dependent/Virtualshelves.t >@@ -1355,7 +1355,7 @@ subtest 'Get shelves containing biblios' => sub { > }; > > subtest 'cannot_be_transferred' => sub { >- plan tests => 12; >+ plan tests => 13; > > # Three patrons and a deleted one > my $staff = $builder->build_object( { class => 'Koha::Patrons', value => { flags => undef } } ); >@@ -1379,6 +1379,24 @@ subtest 'cannot_be_transferred' => sub { > $public_list->cannot_be_transferred( { by => $staff->id, to => $receiver->id } ), 'unauthorized_transfer', > 'Lacks permission' > ); >+ >+ # Give recipient MINIMUM permission >+ $builder->build( >+ { >+ source => 'UserPermission', >+ value => { >+ borrowernumber => $receiver->id, >+ module_bit => 20, >+ code => 'edit_public_list_contents', >+ } >+ } >+ ); >+ is( >+ $public_list->cannot_be_transferred( { by => $staff->id, to => $receiver->id } ), >+ 'unauthorized_transfer', >+ 'Recipient lacks necessary permissions to own public list' >+ ); >+ > my $perms = $builder->build( > { > source => 'UserPermission', >@@ -1387,9 +1405,11 @@ subtest 'cannot_be_transferred' => sub { > } > } > ); >+ > is( >- $public_list->cannot_be_transferred( { by => $staff->id, to => $receiver->id } ), 0, >- 'Minimum permission passes' >+ $public_list->cannot_be_transferred( { by => $staff->id, to => $receiver->id } ), >+ 0, >+ 'Recipient with minimum required permission can accept ownership' > ); > $staff->flags(1)->store; > is( >-- >2.39.5
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