Skip to content

Commit

Permalink
Update security config
Browse files Browse the repository at this point in the history
  • Loading branch information
helenahalldiniths committed Apr 8, 2022
1 parent ab1bd74 commit 9ceed23
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/se/iths/crimedatabase/security/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ protected void configure(HttpSecurity http) throws Exception {
http
.csrf().disable()
.authorizeRequests()
.antMatchers("/criminals").hasRole("ADMIN")
.antMatchers("/victims").hasRole("ADMIN")
.antMatchers("/users").hasRole("ADMIN")
.antMatchers("/").authenticated()
.antMatchers("/addresses").authenticated()
.antMatchers("/categories").authenticated()
.antMatchers("/crimes").authenticated()
.antMatchers("/criminals").authenticated()
.antMatchers("/victims").authenticated()
.antMatchers("/images/**").permitAll()
.anyRequest().authenticated()
.anyRequest().hasRole("ADMIN")
.and()
.formLogin()
.loginPage("/login").permitAll()
Expand Down

0 comments on commit 9ceed23

Please sign in to comment.