diff --git a/app/Helper/Subtask.php b/app/Helper/Subtask.php index 4bb26e777..7d474de02 100644 --- a/app/Helper/Subtask.php +++ b/app/Helper/Subtask.php @@ -14,12 +14,17 @@ class Subtask extends \Kanboard\Core\Base * Get the link to toggle subtask status * * @access public - * @param array $subtask - * @param string $redirect + * @param array $subtask + * @param string $redirect + * @param integer $project_id * @return string */ - public function toggleStatus(array $subtask, $redirect) + public function toggleStatus(array $subtask, $redirect, $project_id = 0) { + if ($project_id > 0 && ! $this->helper->user->hasProjectAccess('subtask', 'edit', $project_id)) { + return trim($this->template->render('subtask/icons', array('subtask' => $subtask))) . $this->helper->e($subtask['title']); + } + if ($subtask['status'] == 0 && isset($this->sessionStorage->hasSubtaskInProgress) && $this->sessionStorage->hasSubtaskInProgress === true) { return $this->helper->url->link( trim($this->template->render('subtask/icons', array('subtask' => $subtask))) . $this->helper->e($subtask['title']), diff --git a/app/ServiceProvider/AuthenticationProvider.php b/app/ServiceProvider/AuthenticationProvider.php index 8600d96e8..b9cdeb757 100644 --- a/app/ServiceProvider/AuthenticationProvider.php +++ b/app/ServiceProvider/AuthenticationProvider.php @@ -134,7 +134,7 @@ class AuthenticationProvider implements ServiceProviderInterface $acl->add('Config', '*', Role::APP_ADMIN); $acl->add('Currency', '*', Role::APP_ADMIN); - $acl->add('Gantt', '*', Role::APP_MANAGER); + $acl->add('Gantt', array('projects', 'saveProjectDate'), Role::APP_MANAGER); $acl->add('Group', '*', Role::APP_ADMIN); $acl->add('Link', '*', Role::APP_ADMIN); $acl->add('Project', array('users', 'allowEverybody', 'allow', 'role', 'revoke', 'create'), Role::APP_MANAGER); diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php index a5d05e497..ad09546eb 100644 --- a/app/Template/board/task_private.php +++ b/app/Template/board/task_private.php @@ -41,15 +41,19 @@ - url->link( - $task['assignee_name'] ?: $task['assignee_username'], - 'board', - 'changeAssignee', - array('task_id' => $task['id'], 'project_id' => $task['project_id']), - false, - 'popover', - t('Change assignee') - ) ?> + user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?> + url->link( + $task['assignee_name'] ?: $task['assignee_username'], + 'BoardPopover', + 'changeAssignee', + array('task_id' => $task['id'], 'project_id' => $task['project_id']), + false, + 'popover', + t('Change assignee') + ) ?> + + e($task['assignee_name'] ?: $task['assignee_username']) ?> + diff --git a/app/Template/board/tooltip_subtasks.php b/app/Template/board/tooltip_subtasks.php index 950da9256..5c273e080 100644 --- a/app/Template/board/tooltip_subtasks.php +++ b/app/Template/board/tooltip_subtasks.php @@ -1,6 +1,6 @@
- subtask->toggleStatus($subtask, 'board') ?> + subtask->toggleStatus($subtask, 'board', $task['project_id']) ?> e(empty($subtask['username']) ? '' : ' ['.$this->user->getFullname($subtask).']') ?>
diff --git a/app/Template/comment/show.php b/app/Template/comment/show.php index 840776682..444576535 100644 --- a/app/Template/comment/show.php +++ b/app/Template/comment/show.php @@ -16,7 +16,7 @@