Bugzilla – Attachment 140630 Details for
Bug 31555
Getting holds via REST API needs edit_borrowers permission
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31555: change holds GET permission to place_holds
Bug-31555-change-holds-GET-permission-to-placehold.patch (text/plain), 2.12 KB, created by
David Nind
on 2022-09-14 12:47:09 UTC
(
hide
)
Description:
Bug 31555: change holds GET permission to place_holds
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-09-14 12:47:09 UTC
Size:
2.12 KB
patch
obsolete
>From 6de83337d183cb22e9d16e1f6752b214b07eb218 Mon Sep 17 00:00:00 2001 >From: Johanna Raisa <johanna.raisa@gmail.com> >Date: Wed, 14 Sep 2022 09:14:24 +0300 >Subject: [PATCH] Bug 31555: change holds GET permission to place_holds > >This patch changes holds' GET REST API endpoint permission >to place_holds to match with request.pl > >Test plan: >1) prove t/db_dependent/api/v1/holds.t > >Sponsored-by: Koha-Suomi Oy > >Signed-off-by: David Nind <david@davidnind.com> >--- > api/v1/swagger/paths/holds.yaml | 2 +- > t/db_dependent/api/v1/holds.t | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/api/v1/swagger/paths/holds.yaml b/api/v1/swagger/paths/holds.yaml >index 617eb3d9d3..7ab45af5b7 100644 >--- a/api/v1/swagger/paths/holds.yaml >+++ b/api/v1/swagger/paths/holds.yaml >@@ -117,7 +117,7 @@ > $ref: "../swagger.yaml#/definitions/error" > x-koha-authorization: > permissions: >- borrowers: edit_borrowers >+ reserveforothers: place_holds > post: > x-mojo-to: Holds#add > operationId: addHold >diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t >index 6665b55116..d85f88bab9 100755 >--- a/t/db_dependent/api/v1/holds.t >+++ b/t/db_dependent/api/v1/holds.t >@@ -185,7 +185,7 @@ subtest "Test endpoints without permission" => sub { > $t->get_ok( "//$nopermission_userid:$password@/api/v1/holds?patron_id=" . $patron_1->borrowernumber ) # no permission > ->status_is(403); > >- $t->get_ok( "//$userid_3:$password@/api/v1/holds?patron_id=" . $patron_1->borrowernumber ) # no permission >+ $t->get_ok( "//$userid_2:$password@/api/v1/holds?patron_id=" . $patron_1->borrowernumber ) # no permission > ->status_is(403); > > $t->post_ok( "//$nopermission_userid:$password@/api/v1/holds" => json => $post_data ) >@@ -225,7 +225,7 @@ subtest "Test endpoints with permission" => sub { > ->status_is(404) > ->json_has('/error'); > >- $t->get_ok( "//$userid_2:$password@/api/v1/holds?patron_id=" . $patron_1->borrowernumber ) >+ $t->get_ok( "//$userid_3:$password@/api/v1/holds?patron_id=" . $patron_1->borrowernumber ) > ->status_is(200) > ->json_is([]); > >-- >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 31555
:
140611
|
140630
|
141503