Bugzilla – Attachment 127773 Details for
Bug 29510
objects.find should call search_limited if present
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29510: Make objects.find call search_limited if present
Bug-29510-Make-objectsfind-call-searchlimited-if-p.patch (text/plain), 1.36 KB, created by
Martin Renvoize (ashimema)
on 2021-11-18 07:56:15 UTC
(
hide
)
Description:
Bug 29510: Make objects.find call search_limited if present
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-11-18 07:56:15 UTC
Size:
1.36 KB
patch
obsolete
>From 05586c24fcd5706420193a8bbc9d83c3f4a3327e Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 17 Nov 2021 18:03:00 -0300 >Subject: [PATCH] Bug 29510: Make objects.find call search_limited if present > >This patch makes objects.find 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> >--- > Koha/REST/Plugin/Objects.pm | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/Koha/REST/Plugin/Objects.pm b/Koha/REST/Plugin/Objects.pm >index 7b843bafbe..33899568f4 100644 >--- a/Koha/REST/Plugin/Objects.pm >+++ b/Koha/REST/Plugin/Objects.pm >@@ -62,6 +62,9 @@ the requested object. It passes through any embeds if specified. > } > ); > >+ $result_set = $result_set->search_limited >+ if $result_set->can('search_limited'); >+ > my $object = $result_set->find( $id, $attributes ); > > return unless $object; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29510
:
127759
|
127760
|
127761
|
127772
|
127773
|
127774
|
161253
|
161254
|
161255
|
161477
|
161478
|
161479