We should use it internally to avoid any leaks.
Created attachment 127751 [details] [review] Bug 29506: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 127752 [details] [review] 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>
Created attachment 127753 [details] [review] Bug 29506: (follow-up) Adapt GET /patrons This patch makes GET /patrons rely on this new behavior from the objects.search helper. To test: 1. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons.t => SUCCESS: Tests pass! 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests still pass! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 127754 [details] [review] Bug 29506: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 127755 [details] [review] 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>
Created attachment 127756 [details] [review] Bug 29506: (follow-up) Adapt GET /patrons This patch makes GET /patrons rely on this new behavior from the objects.search helper. To test: 1. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons.t => SUCCESS: Tests pass! 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests still pass! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Nice future-proofing here.. tests all make sense and pass.. including the /patrons regression test introduced in the prior bug. Signing off
Created attachment 128668 [details] [review] Bug 29506: Regression tests 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>
Created attachment 128669 [details] [review] 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>
Created attachment 128670 [details] [review] Bug 29506: (follow-up) Adapt GET /patrons This patch makes GET /patrons rely on this new behavior from the objects.search helper. To test: 1. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons.t => SUCCESS: Tests pass! 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests still pass! 4. 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>
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
Pushed to 21.11.x for 21.11.02
Created attachment 129299 [details] [review] [21.05.x] Bug 29506: Regression tests 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>
Created attachment 129300 [details] [review] [21.05.x] 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>
Created attachment 129301 [details] [review] [21.05.x] Bug 29506: (follow-up) Adapt GET /patrons This patch makes GET /patrons rely on this new behavior from the objects.search helper. To test: 1. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons.t => SUCCESS: Tests pass! 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests still pass! 4. 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>
Pushed to 21.05.x for 21.05.08
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.