Merge branch '1.5.x' into 2.0.x
This commit is contained in:
@@ -42,20 +42,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
@EnableGlobalMethodSecurity(securedEnabled = true)
|
||||
public class SampleMethodSecurityApplication implements WebMvcConfigurer {
|
||||
|
||||
@Controller
|
||||
protected static class HomeController {
|
||||
|
||||
@GetMapping("/")
|
||||
@Secured("ROLE_ADMIN")
|
||||
public String home(Map<String, Object> model) {
|
||||
model.put("message", "Hello World");
|
||||
model.put("title", "Hello Home");
|
||||
model.put("date", new Date());
|
||||
return "home";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addViewControllers(ViewControllerRegistry registry) {
|
||||
registry.addViewController("/login").setViewName("login");
|
||||
@@ -118,4 +104,18 @@ public class SampleMethodSecurityApplication implements WebMvcConfigurer {
|
||||
|
||||
}
|
||||
|
||||
@Controller
|
||||
protected static class HomeController {
|
||||
|
||||
@GetMapping("/")
|
||||
@Secured("ROLE_ADMIN")
|
||||
public String home(Map<String, Object> model) {
|
||||
model.put("message", "Hello World");
|
||||
model.put("title", "Hello Home");
|
||||
model.put("date", new Date());
|
||||
return "home";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user