Commit 155d77d1 by Antonio Rueda

Corregidos algunos errores en la protección de los paths

parent d1d9bbc6
......@@ -29,10 +29,10 @@ public class ServicioSeguridad {
.httpBasic(httpBasic -> httpBasic.realmName("reservas"))
.authorizeHttpRequests(request -> request
.requestMatchers(HttpMethod.GET, "/reservas/usuarios/{email}")
.access(new WebExpressionAuthorizationManager("hasRole('DIRECCION') or (hasRole('USUARIO') and #email == principal.username)"))
.access(new WebExpressionAuthorizationManager("hasRole('DIRECCION') or (hasRole('CLIENTE') and #email == principal.username)"))
.requestMatchers(HttpMethod.POST, "/reservas/hoteles").hasRole("DIRECCION")
.requestMatchers(HttpMethod.POST, "/reservas/hoteles/{id}/reservas").hasAnyRole("DIRECCION", "USUARIO")
.requestMatchers(HttpMethod.POST, "/reservas/**").permitAll()
.requestMatchers(HttpMethod.POST, "/reservas/hoteles/{id}/reservas").hasAnyRole("DIRECCION", "CLIENTE")
.requestMatchers("/reservas/**").permitAll()
)
.build();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment