Expression-Based Access Control (#517)
* Expression-Based Access Control PermitAll, hasRole, hasAnyRole etc. I modified classes regards to Security * Added test cases for Spring Security Expressions
This commit is contained in:
committed by
Grzegorz Piwowarek
parent
34414b2a43
commit
042878628f
@@ -44,8 +44,9 @@ public class SecurityWithoutCsrfConfig extends WebSecurityConfigurerAdapter {
|
||||
http
|
||||
.csrf().disable()
|
||||
.authorizeRequests()
|
||||
.antMatchers("/admin/*").hasAnyRole("ROLE_ADMIN")
|
||||
.anyRequest().authenticated()
|
||||
.antMatchers("/auth/admin/*").hasRole("ADMIN")
|
||||
.antMatchers("/auth/*").hasAnyRole("ADMIN","USER")
|
||||
.antMatchers("/*").permitAll()
|
||||
.and()
|
||||
.httpBasic()
|
||||
.and()
|
||||
|
||||
Reference in New Issue
Block a user