Patch from Michael Peters to protect cut-in-line holds from staff without the appropr...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 4 May 2011 04:40:16 +0000 (04:40 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 4 May 2011 04:40:16 +0000 (04:40 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@20394 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm

index 6ce8691..f56a52d 100644 (file)
@@ -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