Fix: opened an endpoint on announcements.
This commit is contained in:
@@ -37,16 +37,16 @@ public class SecurityConfig {
|
||||
.csrf(csrf -> csrf.disable())
|
||||
.sessionManagement(sm -> sm.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
||||
.exceptionHandling(ex -> ex
|
||||
.authenticationEntryPoint(authEntryPoint)
|
||||
.accessDeniedHandler(accessDeniedHandler)
|
||||
.authenticationEntryPoint(authEntryPoint)
|
||||
.accessDeniedHandler(accessDeniedHandler)
|
||||
)
|
||||
.authorizeHttpRequests(auth -> auth
|
||||
// PUBLICAS
|
||||
.requestMatchers("/login").permitAll()
|
||||
.requestMatchers("/announces").permitAll()
|
||||
.requestMatchers("/requests").permitAll()
|
||||
.requestMatchers("/huertos/users/waitlist/limited").permitAll()
|
||||
.requestMatchers("/huertos/users/latest-number").permitAll()
|
||||
.requestMatchers("/announcements").permitAll()
|
||||
.requestMatchers("/requests/mine").permitAll()
|
||||
.requestMatchers("/users/waitlist/limited").permitAll()
|
||||
.requestMatchers("/users/latest-number").permitAll()
|
||||
// PRIVADAS
|
||||
.anyRequest().authenticated()
|
||||
);
|
||||
|
||||
@@ -23,7 +23,6 @@ public class AnnouncementController {
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAnyRole('HUERTOS_ROLE_ADMIN', 'HUERTOS_ROLE_DEV')")
|
||||
public ResponseEntity<List<AnnouncementDto.Response>> getAll() {
|
||||
return ResponseEntity.ok(
|
||||
announcementService.getAll()
|
||||
|
||||
Reference in New Issue
Block a user