Bugzilla – Attachment 96434 Details for
Bug 24232
Fix permissions for deleting a bib record after attaching the last item to another bib
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24232: Regression tests
Bug-24232-Regression-tests.patch (text/plain), 2.12 KB, created by
ByWater Sandboxes
on 2019-12-18 17:32:54 UTC
(
hide
)
Description:
Bug 24232: Regression tests
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2019-12-18 17:32:54 UTC
Size:
2.12 KB
patch
obsolete
>From 828394e1c00707bee4cd24e30a856abebc7a7384 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 17 Dec 2019 14:38:41 -0300 >Subject: [PATCH] Bug 24232: Regression tests > >This patch enhances the tests for the DELETE /biblios/:biblio_id >endpoint so more fine grained permissions are tested. > >It highlights the fact that the required permissions defined on the spec >are not correcttly defined. > >To test: >1. Run: > $ kshell > k$ prove t/db_dependent/api/v1/biblios.t >=> FAIL: Tests fail because the user (that now has subpermissions only) >does not have enough permissions for a non-existent subpermission > >Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> >--- > t/db_dependent/api/v1/biblios.t | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/api/v1/biblios.t b/t/db_dependent/api/v1/biblios.t >index 8bf7e4d97e..6b38b6778e 100644 >--- a/t/db_dependent/api/v1/biblios.t >+++ b/t/db_dependent/api/v1/biblios.t >@@ -98,14 +98,14 @@ subtest 'get() tests' => sub { > > subtest 'delete() tests' => sub { > >- plan tests => 7; >+ plan tests => 9; > > $schema->storage->txn_begin; > > my $patron = $builder->build_object( > { > class => 'Koha::Patrons', >- value => { flags => 9 } >+ value => { flags => 0 } # no permissions > } > ); > my $password = 'thePassword123'; >@@ -115,6 +115,22 @@ subtest 'delete() tests' => sub { > my $item = $builder->build_sample_item(); > my $biblio_id = $item->biblionumber; > >+ $t->delete_ok("//$userid:$password@/api/v1/biblios/$biblio_id") >+ ->status_is(403, 'Not enough permissions makes it return the right code'); >+ >+ # Add permissions >+ $builder->build( >+ { >+ source => 'UserPermission', >+ value => { >+ borrowernumber => $patron->borrowernumber, >+ module_bit => 9, >+ code => 'edit_catalogue' >+ } >+ } >+ ); >+ >+ > # Bibs with items cannot be deleted > $t->delete_ok("//$userid:$password@/api/v1/biblios/$biblio_id") > ->status_is(409); >-- >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 24232
:
96388
|
96389
|
96393
|
96398
|
96434
|
96435
|
96436
|
96455
|
96456
|
96457