Add project restriction to block task edition

This commit is contained in:
Frederic Guillot
2017-04-07 21:46:36 -04:00
parent 481e767d35
commit 003c03a4e6
6 changed files with 44 additions and 8 deletions

View File

@@ -189,6 +189,24 @@ class ProjectRoleHelper extends Base
return true;
}
/**
* Return true if the user can update a task
*
* @public
* @param array $task
* @return bool
*/
public function canUpdateTask(array $task)
{
$role = $this->getProjectUserRole($task['project_id']);
if ($task['owner_id'] != $this->userSession->getId() && $this->hasRestriction($task['project_id'], $role, ProjectRoleRestrictionModel::RULE_TASK_UPDATE_ASSIGNED)) {
return false;
}
return true;
}
/**
* Check project access
*