Bug 29506: Make objects.search call search_limited if present
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 17 Nov 2021 17:30:21 +0000 (14:30 -0300)
committerKyle Hall <kyle@bywatersolutions.com>
Fri, 7 Jan 2022 11:34:38 +0000 (06:34 -0500)
commit547c09ee6a4be06cc90ef749638b92ce216b12ad
tree7c9068da5d0a18ac4ce3cc3975291922cce6ddf6
parenteb2fbbcfd992db0096bfb1b79a7d0f166cf3e3fd
Bug 29506: Make objects.search call search_limited if present

This patch makes objects.search implicitly update the passed
*$result_set* to use search_limited. This way no object leaks could
happen without noticing.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Tests fail because search_limited is not used
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! Results are correctly filtered based on userenv!
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>
Koha/REST/Plugin/Objects.pm