more security on endpoint

This commit is contained in:
Olivier PARPAILLON
2025-07-16 12:45:44 +02:00
parent 682de82447
commit 2a13daaf30
2 changed files with 8 additions and 3 deletions

View File

@@ -38,6 +38,11 @@ public class SecurityConfig {
.authorizeHttpRequests(auth -> auth
.requestMatchers("/api/auth/login").permitAll()
.requestMatchers("/api/clients/**").hasRole("EMPLOYE")
.requestMatchers("/api/address/**").hasRole("EMPLOYE")
.requestMatchers("/api/facture/**").hasRole("EMPLOYE")
.requestMatchers("/api/gametype/**").hasRole("EMPLOYE")
.requestMatchers("/api/location/**").hasRole("EMPLOYE")
.requestMatchers("/api/stock/search/**").permitAll()
.anyRequest().authenticated()
)
.sessionManagement(sess -> sess.sessionCreationPolicy(SessionCreationPolicy.STATELESS))