得到它的工作,如果你正在使用
Thymeleaf3.0.2与Spring 1.4的引导,需要强制版本
3.0.1.RELEASE的
thymeleaf-extras-springsecurity4(因为它继承了2.1.2版不工作结合Thymeleaf 3):
<dependency> <groupId>org.thymeleaf.extras</groupId> <artifactId>thymeleaf-extras-springsecurity4</artifactId> <version>3.0.1.RELEASE</version></dependency>
标签应使用该
hasRole功能。
<div sec:authorize="hasRole('ROLE_ADMIN')">


