Prevents users to convert subtaks to tasks when custom role does not allow it
Fixes #5069
This commit is contained in:
committed by
Frédéric Guillot
parent
4c40fe1931
commit
022b106d2d
@@ -26,6 +26,12 @@ class SubtaskConverterController extends BaseController
|
||||
$task = $this->getTask();
|
||||
$subtask = $this->getSubtask($task);
|
||||
|
||||
if (! $this->helper->projectRole->canCreateTaskInColumn($task['project_id'], $task['column_id'])) {
|
||||
$this->flash->failure(t('You cannot create tasks in this column.'));
|
||||
$this->response->redirect($this->helper->url->to('TaskViewController', 'show', ['task_id' => $task['id']]));
|
||||
return;
|
||||
}
|
||||
|
||||
$task_id = $this->subtaskTaskConversionModel->convertToTask($task['project_id'], $subtask['id']);
|
||||
|
||||
if ($task_id !== false) {
|
||||
|
||||
Reference in New Issue
Block a user