권한별로 분기를 처리(권한에 따라 보이는 html이 다르게!)할 때 편하게 해주는 방법이다!
org.thymeleaf.extras:thymeleaf-extras-springsecurity5
<html xmlns:sec="http://www.w3.org/1999/xhtml">
<html xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
둘 중 하나를 추가해서 사용
sec:authorizeisAnonymous() : 아무런 권한이 없는 사용자일 경우isAuthenticated() : 인증된 사용자일 경우hasRole('권한명') : 특정 권한을 가진 사용자일 경우hasAnyRole('권한명','권한명') : 포함된 권한 중 하나라도 있는 사용자일 경우permitAll : 모든 경우 출력denyAll : 모든 경우 출력하지 않음sec:authenticationprincipal : 인증시 사용된 객체에 대한 정보name : 인증시 사용된 객체의 Username principal.authoriteis : 객체의 권한