summaryrefslogtreecommitdiff
path: root/app/Template/board
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-12-06 17:39:21 -0500
committerFrederic Guillot <fred@kanboard.net>2015-12-06 17:39:21 -0500
commitf0651c48c14f44a21d01c2ee71ebdd0a5ffd81a6 (patch)
tree51f1d6b6c2ad14f692e10e2d6bb44bf071a56301 /app/Template/board
parentbd849ff655f9b31f90425c07e5773c7a4e956c34 (diff)
Restrict actions for project viewers
Diffstat (limited to 'app/Template/board')
-rw-r--r--app/Template/board/task_private.php22
-rw-r--r--app/Template/board/tooltip_subtasks.php2
2 files changed, 14 insertions, 10 deletions
diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php
index a5d05e49..ad09546e 100644
--- a/app/Template/board/task_private.php
+++ b/app/Template/board/task_private.php
@@ -41,15 +41,19 @@
<?php if (! empty($task['owner_id'])): ?>
<span class="task-board-user <?= $this->user->isCurrentUser($task['owner_id']) ? 'task-board-current-user' : '' ?>">
- <?= $this->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')
- ) ?>
+ <?php if ($this->user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?>
+ <?= $this->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')
+ ) ?>
+ <?php else: ?>
+ <?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?>
+ <?php endif ?>
</span>
<?php endif ?>
diff --git a/app/Template/board/tooltip_subtasks.php b/app/Template/board/tooltip_subtasks.php
index 950da925..5c273e08 100644
--- a/app/Template/board/tooltip_subtasks.php
+++ b/app/Template/board/tooltip_subtasks.php
@@ -1,6 +1,6 @@
<section id="tooltip-subtasks">
<?php foreach ($subtasks as $subtask): ?>
- <?= $this->subtask->toggleStatus($subtask, 'board') ?>
+ <?= $this->subtask->toggleStatus($subtask, 'board', $task['project_id']) ?>
<?= $this->e(empty($subtask['username']) ? '' : ' ['.$this->user->getFullname($subtask).']') ?>
<br/>
<?php endforeach ?>