Commit ede9263b by Antonio Rueda

Protección de endpoint para consulta de reservas.

parent 0f3ac0d6
......@@ -31,8 +31,9 @@ public class ServicioSeguridad {
.requestMatchers(HttpMethod.GET, "/reservas/usuarios/{email}")
.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", "CLIENTE")
.requestMatchers("/reservas/**").permitAll()
.requestMatchers(HttpMethod.POST, "/reservas/hoteles/{idHotel}/reservas").hasAnyRole("DIRECCION", "CLIENTE")
.requestMatchers(HttpMethod.GET, "/reservas/hoteles/{idHotel}/reservas/{idReserva}").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