Bugzilla – Attachment 159757 Details for
Bug 35468
Bookings permission mismatch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35468: (follow-up) Test only the specific permission needed
Bug-35468-follow-up-Test-only-the-specific-permiss.patch (text/plain), 2.64 KB, created by
Nick Clemens (kidclamp)
on 2023-12-12 16:55:12 UTC
(
hide
)
Description:
Bug 35468: (follow-up) Test only the specific permission needed
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-12-12 16:55:12 UTC
Size:
2.64 KB
patch
obsolete
>From 9fb088ee27a470971afb844307eca5b1bbd5c0ca Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 12 Dec 2023 16:52:14 +0000 >Subject: [PATCH] Bug 35468: (follow-up) Test only the specific permission > needed > >The tests were granting circulation top-level permissions - we should be able to >perform the actions with only 'manage_bookings'. This patch updates the tests to >use the narrower permission. > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/api/v1/bookings.t | 36 +++++++++++++++++++++++++++++--- > 1 file changed, 33 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/api/v1/bookings.t b/t/db_dependent/api/v1/bookings.t >index e5eb75120e6..bbaff2ee863 100755 >--- a/t/db_dependent/api/v1/bookings.t >+++ b/t/db_dependent/api/v1/bookings.t >@@ -194,7 +194,17 @@ subtest 'add() tests' => sub { > my $librarian = $builder->build_object( > { > class => 'Koha::Patrons', >- value => { flags => 2**1 } # circulate flag = 1 >+ value => { flags => 0 } # no additional permissions >+ } >+ ); >+ $builder->build( >+ { >+ source => 'UserPermission', >+ value => { >+ borrowernumber => $librarian->borrowernumber, >+ module_bit => 1, >+ code => 'manage_bookings', >+ }, > } > ); > my $password = 'thePassword123'; >@@ -273,7 +283,17 @@ subtest 'update() tests' => sub { > my $librarian = $builder->build_object( > { > class => 'Koha::Patrons', >- value => { flags => 2**1 } # circulate flag = 1 >+ value => { flags => 0 } # no additional permissions >+ } >+ ); >+ $builder->build( >+ { >+ source => 'UserPermission', >+ value => { >+ borrowernumber => $librarian->borrowernumber, >+ module_bit => 1, >+ code => 'manage_bookings', >+ }, > } > ); > my $password = 'thePassword123'; >@@ -371,7 +391,17 @@ subtest 'delete() tests' => sub { > my $librarian = $builder->build_object( > { > class => 'Koha::Patrons', >- value => { flags => 2**1 } # circulate flag = 1 >+ value => { flags => 0 } # no additional permissions >+ } >+ ); >+ $builder->build( >+ { >+ source => 'UserPermission', >+ value => { >+ borrowernumber => $librarian->borrowernumber, >+ module_bit => 1, >+ code => 'manage_bookings', >+ }, > } > ); > my $password = 'thePassword123'; >-- >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 35468
:
159734
|
159746
|
159754
|
159755
|
159756
|
159757
|
159789
|
159790
|
159791
|
159792
|
159793
|
159794
|
159795
|
159796
|
159881