Search

Thymeleaf x SpringSecurity

μŠ€ν”„λ§ μ‹œνλ¦¬ν‹° ν‘œν˜„μ‹

ν‘œν˜„μ‹
κΈ°λŠ₯
μ˜ˆμ‹œ
isAnonymous()
읡λͺ… μ‚¬μš©μžμ΄λ©΄ true
<th:block sec:authorize="isAnonymous()”>
isAuthenticated()
인증되 μ‚¬μš©μžμ΄λ©΄ true
<th:block sec:authorize="isAuthenticated()”>
hasRole(β€™κΆŒν•œβ€™)
ν•΄λ‹Ή κΆŒν•œμ΄ 있으면 true
<th:block sec:authorize="hasRole(’ROLE_USER’)”>
hasAnyRole(β€™κΆŒν•œ1’, β€˜κΆŒν•œ2’)
μ—¬λŸ¬ κΆŒν•œ 쀑 ν•˜λ‚˜λΌλ„ 있으면 true
<th:block sec:authorize="hasAnyRole(’ROLE_USER’, β€˜ROLE_ADMIN’)”>
principal
인증된 μ‚¬μš©μž 정보(UserDetails 기반)
<th:block sec:authentication="principal">
authentication
인증된 μ‚¬μš©μž (Authentication 기반)
<th:block sec:authentication="authentication">