* Move code.
This commit is contained in:
@@ -223,15 +223,16 @@ class executionModel extends model
|
||||
$execution = $this->dao->findByID($executionID)->from(TABLE_EXECUTION)->fetch();
|
||||
if(empty($execution)) return $this->app->control->sendError($this->lang->notFound, helper::createLink('execution', 'all'));
|
||||
if(!$this->app->user->admin && strpos(",{$this->app->user->view->sprints},", ",{$executionID},") === false) $this->accessDenied();
|
||||
|
||||
/* Parent stage can't access. */
|
||||
$childExecutions = $this->getChildExecutions($executionID);
|
||||
if(!empty($childExecutions) && $execution->type == 'stage') return $this->app->control->sendError($this->lang->execution->errorParentExecution, helper::createLink('execution', 'all'));
|
||||
}
|
||||
|
||||
$executionID = key($executions);
|
||||
}
|
||||
|
||||
/* Parent stage can't access. */
|
||||
$execution = $this->dao->findByID($executionID)->from(TABLE_EXECUTION)->fetch();
|
||||
$childExecutions = $this->getChildExecutions($executionID);
|
||||
if(!empty($childExecutions) && $execution->type == 'stage') return $this->app->control->sendError($this->lang->execution->errorParentExecution, helper::createLink('execution', 'all'));
|
||||
|
||||
/* Save session. */
|
||||
$this->executionTao->saveSession((int)$executionID);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user