Bugzilla – Attachment 96455 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.19 KB, created by
Jonathan Druart
on 2019-12-18 18:33:59 UTC
(
hide
)
Description:
Bug 24232: Regression tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-12-18 18:33:59 UTC
Size:
2.19 KB
patch
obsolete
>From 155a7494bb85763ffa95258771a7fce4e1b9d466 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> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > 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