use of se.inera.intyg.webcert.persistence.fragasvar.model.FragaSvar in project webcert by sklintyg.
the class FragaSvarServiceImpl method setVidareBefordrad.
@Override
public List<FragaSvar> setVidareBefordrad(final String intygsId) {
Preconditions.checkArgument(!Strings.isNullOrEmpty(intygsId), "intygsId may not be null or empty");
final WebCertUser user = webCertUserService.getUser();
final List<FragaSvar> fragaSvarList = fragaSvarRepository.findByIntygsReferensIntygsId(intygsId).stream().peek(fs -> authoritiesValidator.given(user, fs.getIntygsReferens().getIntygsTyp()).features(AuthoritiesConstants.FEATURE_HANTERA_FRAGOR).privilege(AuthoritiesConstants.PRIVILEGE_VIDAREBEFORDRA_FRAGASVAR).orThrow()).peek(FragaSvar::setToVidareBefordrad).collect(Collectors.toList());
return fragaSvarRepository.save(fragaSvarList);
}
Aggregations