Bugzilla – Attachment 87108 Details for
Bug 13895
Add routes for checkouts retrieval and renewal
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13895: Remove the opac checks in privileged endpoint
Bug-13895-Remove-the-opac-checks-in-privileged-end.patch (text/plain), 2.29 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-03-27 17:27:28 UTC
(
hide
)
Description:
Bug 13895: Remove the opac checks in privileged endpoint
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-03-27 17:27:28 UTC
Size:
2.29 KB
patch
obsolete
>From 308f5f9028c542c7fc6e005f05aa3d899aeb17c1 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Wed, 20 Feb 2019 21:30:49 +0000 >Subject: [PATCH] Bug 13895: Remove the opac checks in privileged endpoint > >Test plan: >prove t/db_dependent/api/v1/checkouts.t >--- > Koha/REST/V1/Checkout.pm | 11 ----------- > t/db_dependent/api/v1/checkouts.t | 10 +--------- > 2 files changed, 1 insertion(+), 20 deletions(-) > >diff --git a/Koha/REST/V1/Checkout.pm b/Koha/REST/V1/Checkout.pm >index 14a623b34a..a454fc4514 100644 >--- a/Koha/REST/V1/Checkout.pm >+++ b/Koha/REST/V1/Checkout.pm >@@ -105,17 +105,6 @@ sub renew { > my $borrowernumber = $checkout->borrowernumber; > my $itemnumber = $checkout->itemnumber; > >- # Disallow renewal if OpacRenewalAllowed is off and user has insufficient rights >- unless (C4::Context->preference('OpacRenewalAllowed')) { >- my $user = $c->stash('koha.user'); >- unless ($user && haspermission($user->userid, { circulate => "circulate_remaining_permissions" })) { >- return $c->render( >- status => 403, >- openapi => { error => "Opac Renewal not allowed"} >- ); >- } >- } >- > my ($can_renew, $error) = C4::Circulation::CanBookBeRenewed( > $borrowernumber, $itemnumber); > >diff --git a/t/db_dependent/api/v1/checkouts.t b/t/db_dependent/api/v1/checkouts.t >index 141beb4b05..d32cb5595f 100644 >--- a/t/db_dependent/api/v1/checkouts.t >+++ b/t/db_dependent/api/v1/checkouts.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 57; >+use Test::More tests => 54; > use Test::MockModule; > use Test::Mojo; > use t::lib::Mocks; >@@ -187,14 +187,6 @@ $t->request_ok($tx) > required_permissions => { circulate => "circulate_remaining_permissions" } > }); > >-t::lib::Mocks::mock_preference( "OpacRenewalAllowed", 0 ); >-$tx = $t->ua->build_tx(PUT => "/api/v1/checkouts/" . $issue2->issue_id); >-$tx->req->cookies({name => 'CGISESSID', value => $patron_session->id}); >-$t->request_ok($tx) >- ->status_is(403) >- ->json_is({ error => "Opac Renewal not allowed" }); >- >-t::lib::Mocks::mock_preference( "OpacRenewalAllowed", 1 ); > $tx = $t->ua->build_tx(PUT => "/api/v1/checkouts/" . $issue2->issue_id); > $tx->req->cookies({name => 'CGISESSID', value => $session->id}); > $t->request_ok($tx) >-- >2.21.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 13895
:
37146
|
40104
|
40143
|
40588
|
41163
|
41548
|
45817
|
50021
|
51303
|
53816
|
53817
|
53878
|
53889
|
53890
|
53891
|
53901
|
53924
|
54196
|
54685
|
54951
|
56167
|
56506
|
58387
|
69123
|
84765
|
85458
|
85459
|
85460
|
85461
|
85462
|
85463
|
85464
|
85676
|
86120
|
86576
|
86579
|
86580
|
87105
|
87106
|
87107
| 87108 |
87109
|
87110
|
87111
|
87112
|
87113
|
87114
|
87115
|
87200