Bugzilla – Attachment 173655 Details for
Bug 37392
Edit item permission by library group is broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37392: can_see_things_from is always checking patron visibility
Bug-37392-canseethingsfrom-is-always-checking-patr.patch (text/plain), 2.57 KB, created by
Nick Clemens (kidclamp)
on 2024-10-29 14:24:06 UTC
(
hide
)
Description:
Bug 37392: can_see_things_from is always checking patron visibility
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-10-29 14:24:06 UTC
Size:
2.57 KB
patch
obsolete
>From abe6fe6ef29a45086090ec88958a540444384722 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 23 Jul 2024 13:26:12 +0000 >Subject: [PATCH] Bug 37392: can_see_things_from is always checking patron > visibility > >When trying to edit items, we are seeing the button visibility affected by a patron's >permission to view patrons form any library. > >This is because can_edit_items_from is calling can_see_things_from - which is ultimately calling >libraries_where_can_see_patrons > >That last call should be to libraries_where_can_see_things. This patch corrects that, and passes forward the group feature to check against > >To test: > >Set up library group: >* Create a library group for library A + B >* Action: Limit item editing by group > >Set up test user: >* Create a staff patron with these permissions: > * catalogue > * fast_cataloguing > * edit_items > * view_borrower_infos_from_any_libraries > * edit borrowers >* Home library: library A > >Set up test items: >* Create a record with 3 items with different home libraries: > * A > * B > * C > >We expect the user will be allowed to edit A and B, but not C. > >Test: >* Test editing the items with the test user, only A is allowed to be edited. >* Remove the view_borrower_infos_from_any_libraries permission from test user. >* Test editing items now behaves as expected: A + B are allowed, C is not. > >Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> >Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> >--- > Koha/Patron.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 59bf29d7301..7de0d8c800f 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -1821,6 +1821,7 @@ sub can_see_patrons_from { > branchcode => $branchcode, > permission => 'borrowers', > subpermission => 'view_borrower_infos_from_any_libraries', >+ group_feature => 'ft_hide_patron_info', > } > ); > } >@@ -1848,6 +1849,7 @@ sub can_edit_items_from { > branchcode => $branchcode, > permission => 'editcatalogue', > subpermission => 'edit_any_item', >+ group_feature => 'ft_limit_item_editing', > } > ); > } >@@ -1922,7 +1924,7 @@ sub can_see_things_from { > $can = 1; > } elsif ( $self->has_permission( { $permission => $subpermission } ) ) { > $can = 1; >- } elsif ( my @branches = $self->libraries_where_can_see_patrons ) { >+ } elsif ( my @branches = $self->libraries_where_can_see_things($params) ) { > $can = ( any { $_ eq $branchcode } @branches ) ? 1 : 0; > } > return $can; >-- >2.39.5
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 37392
:
169433
|
169434
|
169515
|
169516
|
169517
|
170392
|
170393
|
170394
|
172698
|
172699
|
172700
|
173654
|
173655
|
173656
|
173657
|
173699
|
173700
|
173701
|
173702
|
173703
|
173871
|
173889
|
175413