Bug 14868: Display required permissions in permission error response
authorLari Taskula <larit@student.uef.fi>
Tue, 23 Aug 2016 12:38:44 +0000 (15:38 +0300)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 2 Sep 2016 12:20:36 +0000 (12:20 +0000)
commit985265c0be182342374f50d95493ec3d50bdd5e0
tree805fc01c73fc7602888b59b2f1c470c271a2214b
parent00a50a9400fd606fdaed59574d0ae5bdf8fe3f2a
Bug 14868: Display required permissions in permission error response

When user does not have required permissions to use API operation, it would be
useful to let them know which permissions he is missing. Since they are now
defined in Swagger, we can easily render them into the response.

To test:
1. Use a patron without any permissions
2. Make GET request to http://yourlib/api/v1/patrons
3. Observe permission error and see that required_permissions are displayed.
4. Run t/db_dependent/api/v1/patrons.t

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/REST/V1.pm
t/db_dependent/api/v1/patrons.t