fix(get tasks): improve tests and add ability to fetch group tasks (#12339)

This commit is contained in:
Matteo Pagliazzi
2020-06-26 16:50:49 +02:00
committed by GitHub
parent c7eae6f26b
commit 359ef47ce7
3 changed files with 156 additions and 47 deletions

View File

@@ -21,6 +21,7 @@ const types = Tasks.tasksTypes.map(type => `${type}s`);
// _allCompletedTodos is currently in BETA and is likely to be removed in future
types.push('completedTodos', '_allCompletedTodos');
// @TODO abstract this snipped (also see api-v3/tasks.js)
function canNotEditTasks (group, user, assignedUserId) {
const isNotGroupLeader = group.leader !== user._id;
const isManager = Boolean(group.managers[user._id]);