Apply column restrictions to the board

This commit is contained in:
Frederic Guillot
2016-09-08 22:33:16 -04:00
parent fedf4ea2de
commit 75470c7242
14 changed files with 383 additions and 169 deletions

View File

@@ -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;
}
}