summaryrefslogtreecommitdiff
path: root/app/Helper
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/Helper
parentbd849ff655f9b31f90425c07e5773c7a4e956c34 (diff)
Restrict actions for project viewers
Diffstat (limited to 'app/Helper')
-rw-r--r--app/Helper/Subtask.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/Helper/Subtask.php b/app/Helper/Subtask.php
index 4bb26e77..7d474de0 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']),