From c4712e867564b4461f3948e2e2b0bc9d02a0c430 Mon Sep 17 00:00:00 2001 From: Janusz Kaczmarek Date: Thu, 24 Feb 2022 21:26:46 +0100 Subject: [PATCH] Bug 30178: Every librarian can edit every item with IndependentBranches on Problem arises after applying bugfix #27526: with IndependentBranches on, a librarian without superlibrarian privileges, can edit every item (i.e. also from a foreign branch). This is because can_be_edited calculation is buggy. Test plan: ========= 1. Have (at least) two branches defined. 2. Have IndependentBranches set. 3. Have a biblio record with items belonging to different branches. 4. Be a librarian without superlibrarian rights. 5. Go to Edit -> Edit items view (cataloguing/additems.pl). 6. You will be able to edit every item, also ones not from the branch you are from. 7. Apply the patch. 8. Repeat 5. 9. You should be able to edit only the items from your branch. --- koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt index 825e4c1c3a..aa02320f52 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -80,7 +80,7 @@ [% FOREACH item IN items %] - [% SET can_be_edited = ! ( Koha.Preference('IndependentBranches') && ! logged_in_user && item.homebranch != Branches.GetLoggedInBranchcode() ) %] + [% SET can_be_edited = ! ( Koha.Preference('IndependentBranches') && ! logged_in_user.is_superlibrarian && item.homebranch != Branches.GetLoggedInBranchname() ) %] [% IF item.itemnumber == itemnumber%] [% UNLESS can_be_edited %] -- 2.30.2