Update permission accès

(cherry picked from commit 9fbd893865)
This commit is contained in:
jleroy
2024-04-23 11:17:54 +02:00
committed by mepiphana2023
parent 91e6f66b56
commit 3a98049e93

View File

@@ -16,7 +16,8 @@ public class WebSecurityConfig {
http.authorizeHttpRequests((requests) -> requests.requestMatchers("/", "/accueil").permitAll()
.requestMatchers("/accueil", "/login", "/inscription", "/searchArticle").permitAll()
.requestMatchers("/css/**", "/images/**", "/assets/**", "/img/**", "/js/**").permitAll()
.requestMatchers("/admin").hasRole("ADMIN")
.requestMatchers("/profile").hasAnyRole("MEMBRE", "ADMIN")
.requestMatchers("/admin").hasRole("MEMBRE")
.anyRequest().authenticated())
.formLogin((form) -> form.loginPage("/login").defaultSuccessUrl("/", true))
.logout((logout) -> logout.clearAuthentication(true).invalidateHttpSession(true)