summaryrefslogtreecommitdiff
path: root/app/Helper/BoardHelper.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-09-08 22:33:16 -0400
committerFrederic Guillot <fred@kanboard.net>2016-09-08 22:33:16 -0400
commit75470c72428c8d8f278d160369558ab31b137fb1 (patch)
tree7fcad6cbc661e2762f1dfa5f643a5beac5217a17 /app/Helper/BoardHelper.php
parentfedf4ea2de21fcf95fc5aa942cedc7924865f160 (diff)
Apply column restrictions to the board
Diffstat (limited to 'app/Helper/BoardHelper.php')
-rw-r--r--app/Helper/BoardHelper.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/Helper/BoardHelper.php b/app/Helper/BoardHelper.php
index f5df3db2..c3d28dc4 100644
--- a/app/Helper/BoardHelper.php
+++ b/app/Helper/BoardHelper.php
@@ -24,4 +24,20 @@ class BoardHelper extends Base
{
return $this->userMetadataCacheDecorator->get(UserMetadataModel::KEY_BOARD_COLLAPSED.$project_id, 0) == 1;
}
+
+ /**
+ * Return true if the task can be moved by the connected user
+ *
+ * @param array $task
+ * @return bool
+ */
+ public function isDraggable(array $task)
+ {
+ if ($task['is_active'] == 1 && $this->helper->user->hasProjectAccess('BoardViewController', 'save', $task['project_id'])) {
+ $srcColumnIds = $this->columnMoveRestrictionCacheDecorator->getAllSrcColumns($task['project_id']);
+ return ! isset($srcColumnIds[$task['column_id']]);
+ }
+
+ return false;
+ }
}