Bugzilla – Attachment 128667 Details for
Bug 29503
GET /patrons should use Koha::Patrons->search_limited
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29503: Make GET /patrons use Koha::Patrons->search_limited
Bug-29503-Make-GET-patrons-use-KohaPatrons-searchl.patch (text/plain), 1.42 KB, created by
Nick Clemens (kidclamp)
on 2021-12-17 14:17:12 UTC
(
hide
)
Description:
Bug 29503: Make GET /patrons use Koha::Patrons->search_limited
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-12-17 14:17:12 UTC
Size:
1.42 KB
patch
obsolete
>From eec2fbf8a1c9da8691c032223f8033bb24df44ea Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 17 Nov 2021 13:07:12 -0300 >Subject: [PATCH] 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> >--- > Koha/REST/V1/Patrons.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/REST/V1/Patrons.pm b/Koha/REST/V1/Patrons.pm >index 80b64ee963..be00526b05 100644 >--- a/Koha/REST/V1/Patrons.pm >+++ b/Koha/REST/V1/Patrons.pm >@@ -49,7 +49,7 @@ sub list { > $query->{debarred} = { '!=' => undef } > if $restricted; > >- my $patrons_rs = Koha::Patrons->search($query); >+ my $patrons_rs = Koha::Patrons->search_limited($query); > my $patrons = $c->objects->search( $patrons_rs ); > > return $c->render( >-- >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 29503
:
127735
|
127736
|
127737
|
127738
|
128666
| 128667