Search in sources :

Example 1 with NoteIsLockedError

use of uk.ac.ebi.spot.goci.curation.model.errors.NoteIsLockedError 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());
    }
    if (!notification.hasErrors()) {
        studyNoteService.saveStudyNote(studyNote);
    }
    return notification;
}
Also used : NoteIsLockedError(uk.ac.ebi.spot.goci.curation.model.errors.NoteIsLockedError) ErrorNotification(uk.ac.ebi.spot.goci.curation.model.errors.ErrorNotification)

Aggregations

ErrorNotification (uk.ac.ebi.spot.goci.curation.model.errors.ErrorNotification)1 NoteIsLockedError (uk.ac.ebi.spot.goci.curation.model.errors.NoteIsLockedError)1