wrap permission and status check around hold request time changing
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 30 Oct 2009 13:46:41 +0000 (13:46 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 30 Oct 2009 13:46:41 +0000 (13:46 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14700 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 54973de..22212dc 100644 (file)
@@ -694,6 +694,14 @@ sub update_hold_impl {
 
 
     # --------------------------------------------------------------
+    # Changing the request time is like playing God
+    # --------------------------------------------------------------
+    if($hold->request_time ne $orig_hold->request_time) {
+        return OpenILS::Event->new('BAD_PARAMS') if $hold->fulfillment_time;
+        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 
     # lib changes we need to create a new transit.
     # --------------------------------------------------------------