Add project restriction to block task edition
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user