UnavailableTaskException, AccessDeniedException {
UserRoles credentials = _authProvider.authenticate(participantToken);
Task task = dao.fetchTaskIfExists(taskID);
checkIsAvailable(taskID, task, credentials);
if (task instanceof ITaskWithAttachments == false) {
throw new UnavailableTaskException("Task does not support attachments");
}
ITaskWithAttachments taskWithAttachments = (ITaskWithAttachments) task;
taskWithAttachments.addAttachment(attachment);
dao.updateTask(task);
dao.commit();