From 8f1d3bd63bdb04cfe932162ce73cd870b84342d5 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 16 May 2025 17:02:42 +0000 Subject: [PATCH] Bug 39927: Add permissions check to PatronSelfRegistrationAlert on home page This patch adds a permissions check around the display of PatronSelfRegistrationAlert information on the staff interface home page. To test, apply the patch and follow the test plan on Bug 35028: 1. Create patron category SELFREG 2. Enable PatronSelfRegistration and set PatronSelfRegistrationDefaultCategory to SELFREG and PatronSelfRegistrationAlert to "Show" 3. Go to OPAC, logout if needed, and create a new account. Remember the value you set for home library. 4. Go to staff interface, set the current library to the one you set in step 3. Now view the staff interface home page as two different users: - A user with either CAN_user_borrowers_edit_borrowers or CAN_user_borrowers_list_borrowers permission. - A user with neither. - The self-registration information should display or not depending on the user's permission. Sponsored-by: Athens County Public Libraries --- .../prog/en/modules/intranet-main.tt | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt index 91172dac2af..e1f69f100d6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt @@ -275,24 +275,26 @@ [% END %] - [% IF self_registered_count %] -
- Self-registrations from: - All libraries: [% self_registered_count | html %] - - [% IF self_registered_mybranch_count %] - / + [% IF (CAN_user_borrowers_edit_borrowers) || (CAN_user_borrowers_list_borrowers) %] + [% IF self_registered_count %] +
+ Self-registrations from: [% Branches.GetLoggedInBranchname | html %]: [% self_registered_mybranch_count | html %]All libraries: [% self_registered_count | html %] - [% END %] -
+ + [% IF self_registered_mybranch_count %] + / + [% Branches.GetLoggedInBranchname | html %]: [% self_registered_mybranch_count | html %] + [% END %] +
+ [% END %] [% END %] [% END %] -- 2.39.5