From 978c3ec3e74a0715eb724a07491ad70370584869 Mon Sep 17 00:00:00 2001 From: pierrehenri-dauvergne Date: Fri, 8 Nov 2024 14:31:31 +0100 Subject: [PATCH 1/3] shanoir-issue#2492: fix id -> examinationId --- .../shanoir/ng/examination/service/ExaminationService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shanoir-ng-datasets/src/main/java/org/shanoir/ng/examination/service/ExaminationService.java b/shanoir-ng-datasets/src/main/java/org/shanoir/ng/examination/service/ExaminationService.java index 8e0f0e047b..0383826a15 100644 --- a/shanoir-ng-datasets/src/main/java/org/shanoir/ng/examination/service/ExaminationService.java +++ b/shanoir-ng-datasets/src/main/java/org/shanoir/ng/examination/service/ExaminationService.java @@ -45,10 +45,10 @@ public interface ExaminationService { * @throws EntityNotFoundException * @throws ShanoirException */ - @PreAuthorize("hasRole('ADMIN') or (hasRole('EXPERT') and @datasetSecurityService.hasRightOnExamination(#id, 'CAN_ADMINISTRATE'))") + @PreAuthorize("hasRole('ADMIN') or (hasRole('EXPERT') and @datasetSecurityService.hasRightOnExamination(#examinationId, 'CAN_ADMINISTRATE'))") void deleteById(Long id, ShanoirEvent event) throws ShanoirException, SolrServerException, IOException, RestServiceException; - @PreAuthorize("hasRole('ADMIN') or (hasRole('EXPERT') and @datasetSecurityService.hasRightOnExamination(#id, 'CAN_ADMINISTRATE'))") + @PreAuthorize("hasRole('ADMIN') or (hasRole('EXPERT') and @datasetSecurityService.hasRightOnExamination(#examinationId, 'CAN_ADMINISTRATE'))") void deleteExaminationAsync(Long examinationId, Long studyId, ShanoirEvent event); /** From 79b821964ebbfba1a8bbca2e27a5a6a9dd0ee2d0 Mon Sep 17 00:00:00 2001 From: pierrehenri-dauvergne Date: Fri, 8 Nov 2024 14:34:48 +0100 Subject: [PATCH 2/3] shanoir-issue#2492: fix param name --- .../org/shanoir/ng/examination/service/ExaminationService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shanoir-ng-datasets/src/main/java/org/shanoir/ng/examination/service/ExaminationService.java b/shanoir-ng-datasets/src/main/java/org/shanoir/ng/examination/service/ExaminationService.java index 0383826a15..ef5fa2da6a 100644 --- a/shanoir-ng-datasets/src/main/java/org/shanoir/ng/examination/service/ExaminationService.java +++ b/shanoir-ng-datasets/src/main/java/org/shanoir/ng/examination/service/ExaminationService.java @@ -46,7 +46,7 @@ public interface ExaminationService { * @throws ShanoirException */ @PreAuthorize("hasRole('ADMIN') or (hasRole('EXPERT') and @datasetSecurityService.hasRightOnExamination(#examinationId, 'CAN_ADMINISTRATE'))") - void deleteById(Long id, ShanoirEvent event) throws ShanoirException, SolrServerException, IOException, RestServiceException; + void deleteById(Long examinationId, ShanoirEvent event) throws ShanoirException, SolrServerException, IOException, RestServiceException; @PreAuthorize("hasRole('ADMIN') or (hasRole('EXPERT') and @datasetSecurityService.hasRightOnExamination(#examinationId, 'CAN_ADMINISTRATE'))") void deleteExaminationAsync(Long examinationId, Long studyId, ShanoirEvent event); From 1c949400269bc237f83d6178795090fa7badd39f Mon Sep 17 00:00:00 2001 From: pierrehenri-dauvergne Date: Fri, 8 Nov 2024 14:47:24 +0100 Subject: [PATCH 3/3] shanoir-issue#2492: fix tests --- .../shanoir/ng/examination/service/ExaminationService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shanoir-ng-datasets/src/main/java/org/shanoir/ng/examination/service/ExaminationService.java b/shanoir-ng-datasets/src/main/java/org/shanoir/ng/examination/service/ExaminationService.java index ef5fa2da6a..18b76e366d 100644 --- a/shanoir-ng-datasets/src/main/java/org/shanoir/ng/examination/service/ExaminationService.java +++ b/shanoir-ng-datasets/src/main/java/org/shanoir/ng/examination/service/ExaminationService.java @@ -45,8 +45,8 @@ public interface ExaminationService { * @throws EntityNotFoundException * @throws ShanoirException */ - @PreAuthorize("hasRole('ADMIN') or (hasRole('EXPERT') and @datasetSecurityService.hasRightOnExamination(#examinationId, 'CAN_ADMINISTRATE'))") - void deleteById(Long examinationId, ShanoirEvent event) throws ShanoirException, SolrServerException, IOException, RestServiceException; + @PreAuthorize("hasRole('ADMIN') or (hasRole('EXPERT') and @datasetSecurityService.hasRightOnExamination(#id, 'CAN_ADMINISTRATE'))") + void deleteById(Long id, ShanoirEvent event) throws ShanoirException, SolrServerException, IOException, RestServiceException; @PreAuthorize("hasRole('ADMIN') or (hasRole('EXPERT') and @datasetSecurityService.hasRightOnExamination(#examinationId, 'CAN_ADMINISTRATE'))") void deleteExaminationAsync(Long examinationId, Long studyId, ShanoirEvent event);