From b4a21acfe3062d071b9bcc3a06e9f8f85d979360 Mon Sep 17 00:00:00 2001 From: Hammat Wele Date: Mon, 28 Aug 2023 17:15:04 +0000 Subject: [PATCH] Bug 34631: Independentbranches - Non-superuser should not be able to write Additional contents for other branches When syspref Independentbranches is enabled Non-superuser should not be able to write Additional contents for other branches To reproduce: 1- Connect to staff interface as superlibrarian 2- Enable IndependentBranches preference 3- Go to Tools -> HTML customizations 4- Crete an additional content for all libraries 5- Create or edit a borrower 5-1- Set permission for the borrower - catalogue - edit_additional_contents 4- Log in to the staff interface with the non-superlibrarian staff user 5- Go to Tools -> HTML customizations --> you can delete or edit the additional contents created by superlibrarian for All libraries 6- Click on New entry --> you can add additional content for other branches 7- Apply the patch 8- Repeat step 5 --> you cannot delete or edit the additional contents create by superlibrarian for All libraries 9- Repeat step 6 --> you cannot add additional content for other branches 10- submit the form --> the branch of the created additional content is the current user branch --- .../prog/en/modules/tools/additional-contents.tt | 10 ++++++++-- tools/additional-contents.pl | 8 ++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt index 650ee9de53..17d7d31711 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt @@ -216,6 +216,7 @@ [% PROCESS locations_options location => additional_content.location %] + [% UNLESS my_branch %]
  • + [% END %] [% UNLESS languages.size %]
  • [% IF category == 'news' %] @@ -366,7 +368,9 @@ [% FOREACH c IN additional_contents%] [% IF ( c.is_expired ) %][% ELSE %][% END %] + [% UNLESS ( my_branch && my_branch != c.branchcode ) %] + [% END %] [% IF c.category == 'news' || c.category == 'pages' %] @@ -410,7 +414,7 @@ [% END %]