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();