/**
  * Authorises a delivery execution
  *
  * @throws \common_Exception
  * @throws \oat\oatbox\service\ServiceNotFoundException
  */
 public function authoriseExecutions()
 {
     $deliveryExecution = $this->getRequestParameter('execution');
     $reason = $this->getRequestParameter('reason');
     $testCenter = $this->getRequestParameter('testCenter');
     if (!is_array($deliveryExecution)) {
         $deliveryExecution = array($deliveryExecution);
     }
     try {
         $authorised = DeliveryHelper::authoriseExecutions($deliveryExecution, $reason, $testCenter);
         $notAuthorised = array_diff($deliveryExecution, $authorised);
         $this->returnJson(array('success' => !count($notAuthorised), 'processed' => $authorised, 'unprocessed' => $notAuthorised));
     } catch (ServiceNotFoundException $e) {
         \common_Logger::w('No delivery service defined for proctoring');
         $this->returnError('Proctoring interface not available');
     }
 }