From 7014d83953acc6fd06b1710945b7c27170c42e39 Mon Sep 17 00:00:00 2001 From: blake Date: Mon, 8 Dec 2014 15:52:15 -0600 Subject: [PATCH] LP1194860 You have permission to override some of the failed holds. appearing when it should not for patrons in the OPAC Edit A quick value check before assigning the override variable. This should eliminate the OPAC showing the override option for those who do not have the permission. Signed-off-by: blake --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index c2e6450d2f..66346e83fc 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -1102,7 +1102,10 @@ sub attempt_hold_placement { $hdata->{hold_failed_event} = $result->{last_event}; if ($result->{age_protected_copy}) { - $hdata->{could_override} = 1; + my %temp = %{$hdata->{hold_failed_event}}; + my $theTextcode = $temp{"textcode"}; + $theTextcode.=".override"; + $hdata->{could_override} = $self->editor->allowed( $theTextcode ); $hdata->{age_protect} = 1; } else { $hdata->{could_override} = $result->{place_unfillable} || @@ -1112,7 +1115,10 @@ sub attempt_hold_placement { $hdata->{hold_failed_event} = $result->[0]; if ($result->[3]) { # age_protect_only - $hdata->{could_override} = 1; + my %temp = %{$hdata->{hold_failed_event}}; + my $theTextcode = $temp{"textcode"}; + $theTextcode.=".override"; + $hdata->{could_override} = $self->editor->allowed( $theTextcode ); $hdata->{age_protect} = 1; } else { $hdata->{could_override} = $result->[4] || # place_unfillable -- 2.11.0