]> git.koha-community.org Git - koha.git/commit
Bug 29503: Make GET /patrons use Koha::Patrons->search_limited
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 17 Nov 2021 16:07:12 +0000 (13:07 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 6 Jan 2022 00:03:28 +0000 (14:03 -1000)
commit152bc1f04eb075ea2f3f276e5371263704586a81
tree65c9c536659c637068627f95a9eb0c57b4a7c905
parent2b432cec1d904af62655a77cc91a707a3820e356
Bug 29503: Make GET /patrons use Koha::Patrons->search_limited

This patch makes the controller method use Koha::Patrons->search_limited
so filters based on configuration and permissions apply when fetching
patrons.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: Boo, you get more patrons than you should
3. Apply the patch
4. Repeat 2
=> SUCCESS: Yay! Things are filtered as expected (i.e. using
Koha::Patron->libraries_where_can_see_patrons)
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/REST/V1/Patrons.pm