From 398c0c674d31d2511890409146cd19f2895e9617 Mon Sep 17 00:00:00 2001 From: Emmanuel DEMEY Date: Tue, 11 May 2021 09:26:34 +0200 Subject: [PATCH 1/5] fix: solve issue with code list API --- .../rmes/webservice/CodeListsResources.java | 2 +- .../codes-list/getDetailedCodesList.ftlh | 29 ++++++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/main/java/fr/insee/rmes/webservice/CodeListsResources.java b/src/main/java/fr/insee/rmes/webservice/CodeListsResources.java index d45251b16..61566ac2f 100644 --- a/src/main/java/fr/insee/rmes/webservice/CodeListsResources.java +++ b/src/main/java/fr/insee/rmes/webservice/CodeListsResources.java @@ -61,7 +61,7 @@ public Response getallCodesLists() { @GET @Path("/search") @Produces(MediaType.APPLICATION_JSON) - @Operation(operationId = "getDetailedCodesLisForSearch", summary = "List of codes", + @Operation(operationId = "getDetailedCodesListForSearch", summary = "Return all lists for Advanced Search", responses = { @ApiResponse(content = @Content(mediaType = "application/json", schema = @Schema(implementation = CodeList.class)))}) public Response getDetailedCodesLisForSearch() { String jsonResultat; diff --git a/src/main/resources/request/codes-list/getDetailedCodesList.ftlh b/src/main/resources/request/codes-list/getDetailedCodesList.ftlh index d6fd31761..bb22a4683 100644 --- a/src/main/resources/request/codes-list/getDetailedCodesList.ftlh +++ b/src/main/resources/request/codes-list/getDetailedCodesList.ftlh @@ -2,14 +2,29 @@ SELECT DISTINCT ?id ?labelLg1 ?labelLg2 ?created ?modified ?creator ?contributor FROM <${CODES_LISTS_GRAPH}> WHERE { ?list skos:notation '${NOTATION}' ; - skos:notation ?id ; - dcterms:created ?created ; - dcterms:modified ?modified ; - dc:creator ?creator ; - insee:validationState ?validationState ; - insee:disseminationStatus ?disseminationStatus ; + skos:notation ?id . - dcterms:modified ?modified . + OPTIONAL { + ?list dcterms:created ?created . + } + OPTIONAL { + ?list dc:creator ?creator . + } + OPTIONAL { + ?list dc:contributor ?contributor . + } + OPTIONAL { + ?list insee:validationState ?validationState . + } + OPTIONAL { + ?list insee:disseminationStatus ?disseminationStatus . + } + OPTIONAL { + ?list dc:contributor ?contributor . + } + OPTIONAL { + ?list dcterms:modified ?modified . + } ?list skos:prefLabel ?labelLg1 . FILTER(lang(?labelLg1) = '${LG1}') . OPTIONAL {?list skos:prefLabel ?labelLg2 . From e00cc5523f282eda7b289a3120e231d1bc2f2c81 Mon Sep 17 00:00:00 2001 From: Alice Lambois Date: Tue, 11 May 2021 11:19:59 +0200 Subject: [PATCH 2/5] Change security for documents and links (series and indicators instead of concepts) --- .../fr/insee/rmes/webservice/DocumentsResources.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/fr/insee/rmes/webservice/DocumentsResources.java b/src/main/java/fr/insee/rmes/webservice/DocumentsResources.java index ee4863ef4..0ca8dc330 100644 --- a/src/main/java/fr/insee/rmes/webservice/DocumentsResources.java +++ b/src/main/java/fr/insee/rmes/webservice/DocumentsResources.java @@ -156,7 +156,7 @@ public Response setDocument( /** * Update informations about a document */ - @Secured({ Roles.SPRING_ADMIN, Roles.SPRING_CONCEPTS_CONTRIBUTOR }) + @Secured({ Roles.SPRING_ADMIN, Roles.SPRING_SERIES_CONTRIBUTOR, Roles.SPRING_INDICATOR_CONTRIBUTOR }) @PUT @Path("/document/{id}") @Consumes(MediaType.APPLICATION_JSON) @@ -179,7 +179,7 @@ public Response setDocument( /** * Change the file of a document */ - @Secured({ Roles.SPRING_ADMIN, Roles.SPRING_CONCEPTS_CONTRIBUTOR }) + @Secured({ Roles.SPRING_ADMIN, Roles.SPRING_SERIES_CONTRIBUTOR, Roles.SPRING_INDICATOR_CONTRIBUTOR }) @PUT @Path("/document/{id}/file") @Consumes({MediaType.MULTIPART_FORM_DATA, MediaType.APPLICATION_OCTET_STREAM, "application/vnd.oasis.opendocument.text",MediaType.APPLICATION_JSON }) @@ -203,7 +203,7 @@ public Response changeDocument( /** * Delete a document */ - @Secured({ Roles.SPRING_ADMIN, Roles.SPRING_CONCEPTS_CONTRIBUTOR }) + @Secured({ Roles.SPRING_ADMIN, Roles.SPRING_SERIES_CONTRIBUTOR, Roles.SPRING_INDICATOR_CONTRIBUTOR }) @DELETE @Path("/document/{id}") @Operation(operationId = "deleteDocument", summary = "Delete a document") @@ -245,7 +245,7 @@ public Response getLink(@PathParam(Constants.ID) String id) { /** * Create a new link */ - @Secured({ Roles.SPRING_ADMIN, Roles.SPRING_CONCEPTS_CONTRIBUTOR }) + @Secured({ Roles.SPRING_ADMIN, Roles.SPRING_SERIES_CONTRIBUTOR, Roles.SPRING_INDICATOR_CONTRIBUTOR }) @POST @Path("/link") @Consumes({MediaType.MULTIPART_FORM_DATA, MediaType.APPLICATION_OCTET_STREAM, "application/vnd.oasis.opendocument.text",MediaType.APPLICATION_JSON }) @@ -266,7 +266,7 @@ public Response setLink( /** * Update informations about a link */ - @Secured({ Roles.SPRING_ADMIN, Roles.SPRING_CONCEPTS_CONTRIBUTOR }) + @Secured({ Roles.SPRING_ADMIN, Roles.SPRING_SERIES_CONTRIBUTOR, Roles.SPRING_INDICATOR_CONTRIBUTOR }) @PUT @Path("/link/{id}") @Consumes(MediaType.APPLICATION_JSON) @@ -287,7 +287,7 @@ public Response setLink( /** * Delete a link */ - @Secured({ Roles.SPRING_ADMIN, Roles.SPRING_CONCEPTS_CONTRIBUTOR }) + @Secured({ Roles.SPRING_ADMIN, Roles.SPRING_SERIES_CONTRIBUTOR, Roles.SPRING_INDICATOR_CONTRIBUTOR }) @DELETE @Path("/link/{id}") @Operation(operationId = "deleteLink", summary = "Delete a link") From 4685ef4629c34b9ffb7d2de5273afd44d4aa596d Mon Sep 17 00:00:00 2001 From: Alice Lambois Date: Tue, 11 May 2021 11:50:17 +0200 Subject: [PATCH 3/5] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1b7f74aed..298dfa1fc 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ 3.5.0 2.0.9 4.3.30.RELEASE - 4.2.17.RELEASE + 4.2.20.RELEASE 2.13.3 5.7.0 UTF-8 From fd6855d8eabb5238116e08d757eecccdbe3e968c Mon Sep 17 00:00:00 2001 From: Alice Lambois Date: Tue, 11 May 2021 15:37:46 +0200 Subject: [PATCH 4/5] Update DocumentsResources.java --- src/main/java/fr/insee/rmes/webservice/DocumentsResources.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/fr/insee/rmes/webservice/DocumentsResources.java b/src/main/java/fr/insee/rmes/webservice/DocumentsResources.java index 0ca8dc330..a88fa6e5d 100644 --- a/src/main/java/fr/insee/rmes/webservice/DocumentsResources.java +++ b/src/main/java/fr/insee/rmes/webservice/DocumentsResources.java @@ -131,7 +131,7 @@ public Response downloadDocument(@PathParam(Constants.ID) String id) { /** * Create a new document */ - @Secured({ Roles.SPRING_ADMIN, Roles.SPRING_CONCEPTS_CONTRIBUTOR }) + @Secured({ Roles.SPRING_ADMIN, Roles.SPRING_SERIES_CONTRIBUTOR, Roles.SPRING_INDICATOR_CONTRIBUTOR }) @POST @Path("/document") @Consumes({MediaType.MULTIPART_FORM_DATA, MediaType.APPLICATION_OCTET_STREAM, "application/vnd.oasis.opendocument.text",MediaType.APPLICATION_JSON }) From 11369e3fc9b2e8df099965a5156b051d29570b18 Mon Sep 17 00:00:00 2001 From: Alice Lambois Date: Tue, 11 May 2021 16:42:46 +0200 Subject: [PATCH 5/5] Change version - 3.0.3 --- bauhaus-back-changeLog.txt | 1 + pom.xml | 2 +- src/main/java/fr/insee/rmes/config/swagger/SwaggerConfig.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bauhaus-back-changeLog.txt b/bauhaus-back-changeLog.txt index 050c993f0..59b4e3b09 100644 --- a/bauhaus-back-changeLog.txt +++ b/bauhaus-back-changeLog.txt @@ -1,3 +1,4 @@ +3.0.3 : Mise à jour de spring-security + correction des droits de créations de documents/liens 3.0.2 : Corrections de l'url des documents à la publication 3.0.1 : Rétablissement du swagger et des droits d'accès 3.0.0 : Module Opérations diff --git a/pom.xml b/pom.xml index 298dfa1fc..f88dc696c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ fr.insee.rmes Bauhaus-BO war - 3.0.2 + 3.0.3 Bauhaus-Back-Office Back-office services for Bauhaus https://github.com/InseeFr/Bauhaus-Back-Office diff --git a/src/main/java/fr/insee/rmes/config/swagger/SwaggerConfig.java b/src/main/java/fr/insee/rmes/config/swagger/SwaggerConfig.java index 3676bfd58..0f11febf8 100644 --- a/src/main/java/fr/insee/rmes/config/swagger/SwaggerConfig.java +++ b/src/main/java/fr/insee/rmes/config/swagger/SwaggerConfig.java @@ -30,7 +30,7 @@ public SwaggerConfig(@Context ServletConfig servletConfig) { super(); OpenAPI openApi = new OpenAPI(); - Info info = new Info().title("Bauhaus API").version("3.0.2").description("Rest Endpoints and services Integration used by Bauhaus"); + Info info = new Info().title("Bauhaus API").version("3.0.3").description("Rest Endpoints and services Integration used by Bauhaus"); openApi.info(info); Server server = new Server();