protected function _initDeliveryExecution() {
        $compiledDelivery  = new \core_kernel_classes_Resource(\tao_helpers_Uri::decode($this->getRequestParameter('uri')));
        $user              = common_session_SessionManager::getSession()->getUser();

        $assignmentService = $this->getServiceLocator()->get(AssignmentService::SERVICE_ID);

        $this->verifyDeliveryStartAuthorized($compiledDelivery->getUri());

        //check if the assignment allows the user to start the delivery and the authorization provider
        if (!$assignmentService->isDeliveryExecutionAllowed($compiledDelivery->getUri(), $user) ) {
            throw new common_exception_Unauthorized();
        }
        $stateService = $this->getServiceLocator()->get(StateServiceInterface::SERVICE_ID);
        /** @var DeliveryExecution $deliveryExecution */
        $deliveryExecution = $stateService->createDeliveryExecution($compiledDelivery->getUri(), $user, $compiledDelivery->getLabel());


        return $deliveryExecution;
    }
protected function _initDeliveryExecution() {
        $compiledDelivery  = new \core_kernel_classes_Resource(\tao_helpers_Uri::decode($this->getRequestParameter('uri')));
        $user              = common_session_SessionManager::getSession()->getUser();

        $assignmentService = $this->getServiceLocator()->get(AssignmentService::SERVICE_ID);

        $this->verifyDeliveryStartAuthorized($compiledDelivery->getUri());

        //check if the assignment allows the user to start the delivery and the authorization provider
        if (!$assignmentService->isDeliveryExecutionAllowed($compiledDelivery->getUri(), $user) ) {
            throw new common_exception_Unauthorized();
        }
        $stateService = $this->getServiceLocator()->get(StateServiceInterface::SERVICE_ID);
        /** @var DeliveryExecution $deliveryExecution */
        $deliveryExecution = $stateService->createDeliveryExecution($compiledDelivery->getUri(), $user, $compiledDelivery->getLabel());


        return $deliveryExecution;
    }
protected function _initDeliveryExecution ( ) { $ compiledDelivery = new \ core_kernel_classes_Resource ( \ tao_helpers_Uri :: decode ( $ this -> getRequestParameter ( 'uri' ) ) ) ; $ user = common_session_SessionManager :: getSession ( ) -> getUser ( ) ; $ assignmentService = $ this -> getServiceLocator ( ) -> get ( AssignmentService :: SERVICE_ID ) ; $ this -> verifyDeliveryStartAuthorized ( $ compiledDelivery -> getUri ( ) ) ; //check if the assignment allows the user to start the delivery and the authorization provider if ( ! $ assignmentService -> isDeliveryExecutionAllowed ( $ compiledDelivery -> getUri ( ) , $ user ) ) { throw new common_exception_Unauthorized ( ) ; } $ stateService = $ this -> getServiceLocator ( ) -> get ( StateServiceInterface :: SERVICE_ID ) ; /** @var DeliveryExecution $deliveryExecution */ $ deliveryExecution = $ stateService -> createDeliveryExecution ( $ compiledDelivery -> getUri ( ) , $ user , $ compiledDelivery -> getLabel ( ) ) ; return $ deliveryExecution ; }
Init a delivery execution from the current delivery.

@throws common_exception_Unauthorized
@return DeliveryExecution the selected execution
@throws \common_exception_Error
Init a delivery execution from the current delivery .