- SpringBoot版本:2.0.9.RELEASE
- 命名空间:xmlns:sec=“http://www.thymeleaf.org/extras/spring-security”
- 认证:sec:authorize="isAuthenticated()
- 未认证:sec:authorize="!isAuthenticated()
- 依赖:
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity5</artifactId>
<version>3.0.4.RELEASE</version>
</dependency>
- 不同的用户拥有不同的权限,即在网页中不同的用户需要显示不同的信息
sec:authorize="hasRole('vip3')"