Bug 28948: Make is_public stashed on public routes
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 7 Jan 2021 15:36:42 +0000 (12:36 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 28 Oct 2021 15:32:34 +0000 (17:32 +0200)
commit9b2226a649c48b268afa7acdee8330c43eb1609d
treefdee8bc40b05df699405c7a96493694ed8504f59
parentf6c2147ec755e61266b114a9399c799240223d2b
Bug 28948: Make is_public stashed on public routes

This patch makes the API authentication code stash the 'is_public' value
when public routes are hit.

This will be particularly useful to have $c->objects->search generically
pass this info down to the ->to_api method.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t
=> SUCCESS: Tests pass! When a public route is reached, the controller
has the 'is_public' value stashed
3. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/REST/V1/Auth.pm
t/db_dependent/api/v1/auth_authenticate_api_request.t