From 5c8365e4a748a6e3eadddccc44a196087d4da279 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 10 Apr 2017 17:34:34 -0300 Subject: [PATCH] Bug 18403: REST API - patrons endpoint There is something wrond here, the userenv is no set and so we cannot user search_limited. Should we set the userenv or filter on the libraries using libraries_where_can_see_patrons? WAITING FOR FEEDBACK HERE. Signed-off-by: Signed-off-by: Jon McGowan Signed-off-by: Jonathan Druart --- Koha/REST/V1/Patron.pm | 3 ++- api/v1/swagger/paths/holds.json | 2 +- api/v1/swagger/paths/patrons.json | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Koha/REST/V1/Patron.pm b/Koha/REST/V1/Patron.pm index 7cc7bedffc..8fbe4587e3 100644 --- a/Koha/REST/V1/Patron.pm +++ b/Koha/REST/V1/Patron.pm @@ -24,7 +24,8 @@ use Koha::Patrons; sub list { my $c = shift->openapi->valid_input or return; - my $patrons = Koha::Patrons->search; + # FIXME The limited does not work here, the userenv is not set + my $patrons = Koha::Patrons->search_limited; return $c->render(status => 200, openapi => $patrons); } diff --git a/api/v1/swagger/paths/holds.json b/api/v1/swagger/paths/holds.json index adf1178c70..6bbcd40850 100644 --- a/api/v1/swagger/paths/holds.json +++ b/api/v1/swagger/paths/holds.json @@ -154,7 +154,7 @@ "allow-owner": true, "allow-guarantor": true, "permissions": { - "borrowers": "1" + "borrowers": "edit_borrowers" } } }, diff --git a/api/v1/swagger/paths/patrons.json b/api/v1/swagger/paths/patrons.json index 204ccdf10b..565d20c26e 100644 --- a/api/v1/swagger/paths/patrons.json +++ b/api/v1/swagger/paths/patrons.json @@ -44,7 +44,7 @@ }, "x-koha-authorization": { "permissions": { - "borrowers": "1" + "borrowers": "edit_borrowers" } } } @@ -103,7 +103,7 @@ "allow-owner": true, "allow-guarantor": true, "permissions": { - "borrowers": "1" + "borrowers": "edit_borrowers" } } } -- 2.39.5