public void cancelAllTasks(int wfid, String username) throws SecurityException,
UnknownElementException, StorageException {
Workflow wf = new WorkflowAPI().getWorkflow(wfid, username);
if (!wf.hasRole(username, WorkflowRole.ADMIN)){
throw new SecurityException("Must be admin to cancel all Tasks!");
}
TaskManager.cancelTasks(wfid, username);
}