https://velog.io/@code12/Spring-Security-Spring-Boot%EB%A5%BC-%EC%9D%B4%EC%9A%A9%ED%95%9C-Thymeleaf-%EC%97%B0%EA%B2%B0
Dependency 추가
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity6</artifactId>
</dependency>
name space 추가
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
권한별 제어
| SecurityConfig | Thymeleaf |
|---|
| requestMatchers("/member/**").hasRole("ADMIN") | sec:authorize="hasRole('ADMIN')" |
| requestMatchers("/user/**").hasAnyRole("ADMIN", "USER") | sec:authorize="hasAnyRole('ADMIN', 'USER')" |