Closed jackmew closed 10 years ago
link
set @EnableGlobalMethodSecurity(prePostEnabled=true) => 1. enable global method security 2. enable prePost
@EnableGlobalMethodSecurity(prePostEnabled=true)
comment out //.antMatchers("/strategy/**").hasRole("ADMIN")
and you add @PreAuthorize("hasRole('ROLE_ADMIN')") to the controller you want authorise.
@PreAuthorize("hasRole('ROLE_ADMIN')")
link
set
@EnableGlobalMethodSecurity(prePostEnabled=true)
=> 1. enable global method security 2. enable prePostcomment out //.antMatchers("/strategy/**").hasRole("ADMIN")
and you add
@PreAuthorize("hasRole('ROLE_ADMIN')")
to the controller you want authorise.