Group plans remove unlinked tasks (#8332)

* Added ability to delete tasks that are broken

* Added ability to delete group tasks after leaving group
This commit is contained in:
Keith Holliday
2016-12-30 13:17:39 -06:00
committed by GitHub
parent 97e40c81f3
commit 47d9594679
3 changed files with 45 additions and 1 deletions

View File

@@ -954,7 +954,7 @@ api.deleteTask = {
throw new NotFound(res.t('taskNotFound'));
} else if (task.userId && task.challenge.id && !task.challenge.broken) {
throw new NotAuthorized(res.t('cantDeleteChallengeTasks'));
} else if (task.group.id && task.group.assignedUsers.indexOf(user._id) !== -1) {
} else if (task.group.id && task.group.assignedUsers.indexOf(user._id) !== -1 && !task.group.broken) {
throw new NotAuthorized(res.t('cantDeleteAssignedGroupTasks'));
}