2016년 4월 28일 목요일

20160429 스프링 부트 + 타임리프 + 스프링 시큐리티

https://github.com/thymeleaf/thymeleaf-extras-springsecurity

역시 삽질이 답인것 같습니다.

templateEngine.addDialect(new SpringSecurityDialect());
auth
        .inMemoryAuthentication()
        .withUser("1").password("1").roles("RR_ADMIN", "USER");
httpSecurity.authorizeRequests().antMatchers("/admin/**").hasAnyRole("RR_ADMIN");

기본 세팅을 마친 후 

https://github.com/thymeleaf/thymeleaf-extras-springsecurity
에서처럼 타임리프 안에서 사용할 수 있습니다.
조만간 깃허브에 예제를 만들어 올려보도록 하겠습니다.!
커밍순!