use of uk.ac.ebi.spot.goci.model.Curator in project goci by EBISPOT.
the class StudyOperationsService method addStudyNote.
public ErrorNotification addStudyNote(Study study, StudyNote studyNote, SecureUser user) {
ErrorNotification notification = new ErrorNotification();
//xintodo need to refactor after removing curator table
Curator curator = curatorService.getCuratorIdByEmail(user.getEmail());
studyNote.setCurator(curator);
//user cannot touch system notes
if (studyNoteOperationsService.isSystemNote(studyNote)) {
notification.addError(new NoteIsLockedError());
}
//check if study is published
if (isPublished(study)) {
notification.addError(new StudyIsLockedError());
}
if (!notification.hasErrors()) {
studyNoteService.saveStudyNote(studyNote);
}
return notification;
}
Aggregations