]> 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)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Tue, 11 Jan 2022 14:27:59 +0000 (14:27 +0000)
commitb64d29d1b904053e3186696483b6c0bd7f077319
tree4922abaa2309abc3a1193f6cff4760d648249d94
parent254424495b5b31893e9df108623fc0a359925843
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 7d38b15d65aad783e68957dad43b30d42896f627)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Koha/REST/V1/Patrons.pm