Bug 28907: REST - Remove allow-owner from public checkout availability route
To test: 1. prove t/db_dependent/api/v1/checkouts.t 2. Apply patch 3. prove t/db_dependent/api/v1/checkouts.t Observe success in both cases. Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
This commit is contained in:
parent
e2bc259dda
commit
e6cd5ae59f
|
|
@ -153,7 +153,16 @@ sub get_availability {
|
|||
my $c = shift->openapi->valid_input or return;
|
||||
my $user = $c->stash('koha.user');
|
||||
|
||||
my $patron = Koha::Patrons->find( $c->param('patron_id') );
|
||||
my $patron_id = $c->param('patron_id');
|
||||
|
||||
return if try {
|
||||
$c->auth->public($patron_id) if $c->stash('is_public');
|
||||
return 0; # authorization successful, do not "return" after try-catch
|
||||
} catch {
|
||||
return $c->unhandled_exception($_);
|
||||
};
|
||||
|
||||
my $patron = Koha::Patrons->find($patron_id);
|
||||
my $item = Koha::Items->find( $c->param('item_id') );
|
||||
|
||||
my ( $impossible, $confirmation, $warnings ) =
|
||||
|
|
|
|||
|
|
@ -447,5 +447,3 @@
|
|||
description: Under maintenance
|
||||
schema:
|
||||
$ref: "../swagger.yaml#/definitions/error"
|
||||
x-koha-authorization:
|
||||
allow-owner: true
|
||||
|
|
|
|||
Loading…
Reference in New Issue