There are many places in templates where we link to a system preference and we are inconsistent about whether these links are dependent on the permission of the logged-in user. I propose to add a template plugin which handles the permission check. [% "RequireChoosingExistingAuthority" | 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=RequireChoosingExistingAuthority">RequireChoosingExistingAuthority</a> For a user without permission it outputs: <span class="link_preference">RequireChoosingExistingAuthority</span>
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