Bugzilla – Attachment 102953 Details for
Bug 25142
Staff can access patrons' infos from outside of their group
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25142: Fix wrong grep logical test
Bug-25142-Fix-wrong-grep-logical-test.patch (text/plain), 2.04 KB, created by
Katrin Fischer
on 2020-04-14 22:23:38 UTC
(
hide
)
Description:
Bug 25142: Fix wrong grep logical test
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-04-14 22:23:38 UTC
Size:
2.04 KB
patch
obsolete
>From e564dbc1c7a0e92325592fc48366dcf821b52e54 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 14 Apr 2020 13:22:44 +0200 >Subject: [PATCH] Bug 25142: Fix wrong grep logical test > >To test and understand what's going on, you can try that bit of code: >my @a = qw( a b c a); >my @b = qw( b c d ); >my @c; >@c = grep { 'a' eq $_ } @a ? 'ok' : (); >say @c; >@c = ( grep { 'a' eq $_ } @a ) ? 'ok' : (); >say @c; >@c = grep { 'a' eq $_ } @a ? ('ok') : (undef); >say @c; > >The problem here: >Have patrons in 3 branches CPL, MPL, SPL >Have a non superlibrarian with edit_borrowers permission but >without view_borrower_infos_from_any_libraries, from CPL >Create a library group with CPL, MPL >Use that non superlibrarian to search for patrons >You can search for patrons fro CPL and MPL >BUT, edit the value for CPL, use SPL (edit the DOM) >Search and... oops > >Apply this patch, try again > >Also use a superlibrarian patron (and/or with view_borrower_infos_from_any_libraries) >and confirm that they can see all patrons > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Tested with edit_borrowers permission but NOT view_borrower_infos_from_any_libraries >Editing the DOM I can search (not edit) from any branch >With patch no entries found :) > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >Amended test plan slightly (+ without) >--- > C4/Utils/DataTables/Members.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm >index 5bcd971309..29efd0bd3c 100644 >--- a/C4/Utils/DataTables/Members.pm >+++ b/C4/Utils/DataTables/Members.pm >@@ -57,7 +57,7 @@ sub search { > # Do that after iTotalQuery! > if ( defined $branchcode and $branchcode ) { > @restricted_branchcodes = @restricted_branchcodes >- ? grep { $_ eq $branchcode } @restricted_branchcodes >+ ? grep ({ $_ eq $branchcode } @restricted_branchcodes) > ? ($branchcode) > : (undef) # Do not return any results > : ($branchcode); >-- >2.11.0
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 25142
:
102923
|
102928
|
102952
| 102953