Skip to content
Snippets Groups Projects

feat: two types for comments and adapted permission service

Merged Alicia.DeDiosFuente requested to merge adf-250-comments-for-validator-only into master
All threads resolved!
Files
7
@@ -3,7 +3,6 @@ package ch.unige.aou.controller.admin;
import javax.validation.Valid;
import ch.unige.aou.rest.AouActionName;
import ch.unige.solidify.specification.SolidifySpecification;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpEntity;
@@ -48,15 +47,15 @@ public class PublicationCommentController extends CompositionController<Publicat
@GetMapping
@Override
@PreAuthorize("@publicationPermissionService.isAllowed(#parentid, 'LIST_DEPOSIT_COMMENT')")
@PreAuthorize("@publicationPermissionService.isAllowed(#parentid, 'LIST_DEPOSIT_COMMENTS')")
public HttpEntity<Collection<Comment>> list(@PathVariable String parentid, @ModelAttribute Comment comment, Pageable pageable) {
comment.setOnlyForValidators(false);
return super.list(parentid, comment, pageable);
}
@GetMapping(AouActionName.LIST_VALIDATOR_COMMENTS)
@PreAuthorize("@publicationPermissionService.isAllowed(#parentid, 'LIST_DEPOSIT_COMMENT_AS_VALIDATOR')")
public HttpEntity<Collection<Comment>> listAsValidator(@PathVariable String parentid, @ModelAttribute Comment comment, Pageable pageable) {
@PreAuthorize("@publicationPermissionService.isAllowed(#parentid, 'LIST_DEPOSIT_COMMENTS_AS_VALIDATOR')")
public HttpEntity<Collection<Comment>> listValidatorComments(@PathVariable String parentid, @ModelAttribute Comment comment, Pageable pageable) {
comment.setOnlyForValidators(true);
return super.list(parentid, comment, pageable);
}
Loading