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