|
Description
Owen Leonard
2026-01-21 14:18:35 UTC
Created attachment 191791 [details] [review] Bug 41674: Add template plugin for linking to system preferences based on user permission This patch adds a new template plugin, LinkPref, for displaying system preference names as links depending on the logged-in user's permission. Syntax: [% "SYSTEM_PREFERENCE_NAME" | html | $LinkPref %] For a user with 'CAN_user_parameters_manage_sysprefs' permission it outputs: <a class="link_preference" href="admin/preferences.pl?op=search&ok=Search&searchfield=SYSTEM_PREFERENCE_NAME">SYSTEM_PREFERENCE_NAME</a> For a user without permission it outputs: <span class="link_preference">SYSTEM_PREFERENCE_NAME</span> Sponsored-by: Athens County Public Libraries Created attachment 191792 [details] [review] Bug 41674: (follow-up) Proof of concept: branches.pl This patch implements the new template plugin on Administration -> Libraries. - When viewed as a user with permission to manage system preferences, the system preference names under "Reply-To", "Return-Path", and "MARC organization code" should be linked to system preferences, and the link should take you to the correct preference search. - When viewed as a user without permission the system preference names should not be linked. Sponsored-by: Athens County Public Libraries Created attachment 193369 [details] [review] Bug 41674: Add template plugin for linking to system preferences based on user permission This patch adds a new template plugin, LinkPref, for displaying system preference names as links depending on the logged-in user's permission. Syntax: [% "SYSTEM_PREFERENCE_NAME" | html | $LinkPref %] For a user with 'CAN_user_parameters_manage_sysprefs' permission it outputs: <a class="link_preference" href="admin/preferences.pl?op=search&ok=Search&searchfield=SYSTEM_PREFERENCE_NAME">SYSTEM_PREFERENCE_NAME</a> For a user without permission it outputs: <span class="link_preference">SYSTEM_PREFERENCE_NAME</span> Sponsored-by: Athens County Public Libraries Signed-off-by: David Nind <david@davidnind.com> Created attachment 193370 [details] [review] Bug 41674: (follow-up) Proof of concept: branches.pl This patch implements the new template plugin on Administration -> Libraries. - When viewed as a user with permission to manage system preferences, the system preference names under "Reply-To", "Return-Path", and "MARC organization code" should be linked to system preferences, and the link should take you to the correct preference search. - When viewed as a user without permission the system preference names should not be linked. Sponsored-by: Athens County Public Libraries Signed-off-by: David Nind <david@davidnind.com> A great idea Owen! Testing notes (using KTD): 1. I edited Henry Acevedo's account so I could log in as the patron in an incognito winodw. 2. I gave Henry these permissions: - Staff access, allows viewing of catalogue in staff interface (catalogue) - Manage Koha system settings (Administration panel) (parameters) - Then removed Manage system preferences (manage_sysprefs) |