From 561905d43e84a3997fb97eccc2e3db37109b8383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=A3?= Date: Thu, 25 Apr 2024 03:40:32 -0300 Subject: [PATCH] =?UTF-8?q?Tornando=20o=20endpoint=20/organizations/all=20?= =?UTF-8?q?p=C3=BAblico=20e=20removendo=20os=20n=C3=BAmeros=20de=20telefon?= =?UTF-8?q?e=20das=20institui=C3=A7=C3=B5es=20ao=20listar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../waterproofingdata/wpdauth/controller/UsersController.java | 3 ++- .../waterproofingdata/wpdauth/security/WebSecurityConfig.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/waterproofingdata/wpdauth/controller/UsersController.java b/src/main/java/org/waterproofingdata/wpdauth/controller/UsersController.java index 939b6fe..eddd347 100644 --- a/src/main/java/org/waterproofingdata/wpdauth/controller/UsersController.java +++ b/src/main/java/org/waterproofingdata/wpdauth/controller/UsersController.java @@ -95,9 +95,10 @@ public class UsersController { // Endpoint to get all organizations @GetMapping("/all") - @PreAuthorize("hasRole('ROLE_ADMIN')") public ResponseEntity> getAllOrganizations() { List organizations = organizationsService.getAllOrganizations(); + // Remover o campo 'phone' de cada organização + organizations.forEach(org -> org.setPhone(null)); return new ResponseEntity<>(organizations, HttpStatus.OK); } diff --git a/src/main/java/org/waterproofingdata/wpdauth/security/WebSecurityConfig.java b/src/main/java/org/waterproofingdata/wpdauth/security/WebSecurityConfig.java index 08abe4e..dd1cc3a 100644 --- a/src/main/java/org/waterproofingdata/wpdauth/security/WebSecurityConfig.java +++ b/src/main/java/org/waterproofingdata/wpdauth/security/WebSecurityConfig.java @@ -43,6 +43,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers("/forgotpasswords/findallforgotpasswordquestions").permitAll() // .antMatchers("/forgotpasswords/loginbyusernameandanswers").permitAll() // .antMatchers("/forgotpasswords/loginbyusernameandanswers").permitAll()// + .antMatchers("/organizations/all").permitAll()// // Disallow everything else.. .anyRequest().authenticated();