Bugzilla – Attachment 159796 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.70 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-12-13 12:45:28 UTC
(
hide
)
Description:
Bug 35468: (follow-up) Test only the specific permission needed
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-12-13 12:45:28 UTC
Size:
2.70 KB
patch
obsolete
>From 8b2e6bcf26fe5f3d76133b82099307cc3b576c8c 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> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > 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.43.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 35468
:
159734
|
159746
|
159754
|
159755
|
159756
|
159757
|
159789
|
159790
|
159791
|
159792
|
159793
|
159794
|
159795
| 159796 |
159881