From adc2affe4d525bd9116b3e241b9b4fc4c4e6406c Mon Sep 17 00:00:00 2001 From: Blake Henderson Date: Mon, 8 Dec 2014 15:52:15 -0600 Subject: [PATCH] LP#1194860: 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 Henderson Signed-off-by: Liam Whalen Signed-off-by: Ben Shum --- .../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 97364ed746..3dae3bff52 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -1275,7 +1275,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} || @@ -1285,7 +1288,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.43.2