From: miker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Wed, 4 May 2011 04:40:39 +0000 (+0000)
Subject: Patch from Michael Peters to protect cut-in-line holds from staff without the appropr... 
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=decc9d9f5ca1a752efaef7fabe6bb3b47b6dba7c;p=evergreen%2Ftadl.git

Patch from Michael Peters to protect cut-in-line holds from staff without the appropriate permission

git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_1@20395 dcc99617-32d9-48b4-a31d-7c20da2025e4
---

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
index f8b72dcc04..e316eb3092 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
@@ -795,6 +795,16 @@ sub update_hold_impl {
         return OpenILS::Event->new('BAD_PARAMS') if $hold->fulfillment_time;
         return $e->die_event unless $e->allowed('UPDATE_HOLD_REQUEST_TIME', $hold->pickup_lib);
     }
+    
+	
+	# --------------------------------------------------------------
+	# Code for making sure staff have appropriate permissons for cut_in_line
+	# This, as is, doesn't prevent a user from cutting their own holds in line 
+	# but needs to
+	# --------------------------------------------------------------	
+	if($U->is_true($hold->cut_in_line) ne $U->is_true($orig_hold->cut_in_line)) {
+		return $e->die_event unless $e->allowed('UPDATE_HOLD_REQUEST_TIME', $hold->pickup_lib);
+	}
 
     # --------------------------------------------------------------
     # if the hold is on the holds shelf or in transit and the pickup