Bug 40364: Implement holds history permission

To test:
1 - enable IntranetReadingHistoryHolds system preference
2 - make some holds for a patron, confirm you can see Holds History in the patron record when logged in as a superlibrarian
3 - log in as a non-superlibrarian with edit_borrowers permission, confirm you can see holds history in pthe patron record
4 - apply patch, updatedatabase, restat_all
5 - confirm you can see holds history as a superlibrarian
6 - confirm your non-superlibrarian from step 3 was given view_holds_history permission and can view holds history
7 - remove view_holds_history permission from your user, confirm you can no longer access holds history

Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Andrew Fuerste Henry 2025-09-29 20:04:56 +00:00 committed by Lucas Gass
parent 360fe6ba9a
commit 6e1065e840
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
4 changed files with 9 additions and 7 deletions

View File

@ -53,6 +53,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES
( 4, 'send_messages_to_borrowers', 'Send messages to patrons'),
( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'),
( 4, 'view_checkout_history', 'Viewing checkout history'),
( 4, 'view_holds_history', 'Viewing holds history'),
( 6, 'place_holds', 'Place holds for patrons'),
( 6, 'modify_holds_priority', 'Modify holds priority'),
( 6, 'alter_hold_targets', 'Move holds between items and records'),

View File

@ -206,12 +206,10 @@
<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% patron.borrowernumber | uri %]">Circulation history</a>
</li>
[% END %]
[% IF CAN_user_borrowers_edit_borrowers %]
[% IF ( IntranetReadingHistoryHolds ) %]
<li [% IF holdshistoryview %]class="active"[% END %]>
<a href="/cgi-bin/koha/members/holdshistory.pl?borrowernumber=[% patron.borrowernumber | uri %]">Holds history</a>
</li>
[% END %]
[% IF (CAN_user_borrowers_view_holds_history && Koha.Preference('IntranetReadingHistoryHolds')) %]
<li [% IF holdshistoryview %]class="active"[% END %]>
<a href="/cgi-bin/koha/members/holdshistory.pl?borrowernumber=[% patron.borrowernumber | uri %]">Holds history</a>
</li>
[% END %]
[% IF ( CAN_user_tools_view_system_logs ) %]
<li [% IF logview %]class="active"[% END %]>

View File

@ -332,6 +332,9 @@
[%- CASE 'view_checkout_history' -%]
<span class="sub_permission view_checkout_history"> Viewing checkout history </span>
<span class="permissioncode">([% name | html %])</span>
[%- CASE 'view_holds_history' -%]
<span class="sub_permission view_holds_history"> Viewing holds history </span>
<span class="permissioncode">([% name | html %])</span>
[%- CASE 'suggestions_manage' -%]
<span class="sub_permission suggestions_manage_subpermission"> Edit purchase suggestions </span>
<span class="permissioncode">([% name | html %])</span>

View File

@ -44,7 +44,7 @@
[% INCLUDE 'members-toolbar.inc' %]
<h1>Holds history</h1>
[% UNLESS Koha.Preference('IntranetReadingHistoryHolds') %]
[% UNLESS (Koha.Preference('IntranetReadingHistoryHolds') && CAN_user_borrowers_view_holds_history) %]
<div class="alert alert-warning">Staff members are not allowed to access patron's holds history</div>
[% ELSIF patron.is_anonymous %]
<div class="alert alert-warning">This is the anonymous patron, so no holds history is displayed.</div>