1. 스프링 시큐리티를 이용한 페이지 접근제한

@Secured("ROLE_{RoleType}")  애노테이션 설정시

접속 사용자의 UserRole이 secured의 지정 권한과 일치하지 않으면  403 에러를 반환한다

@Secured("ROLE_ADMIN")
@GetMapping("/admin")
public enum UserRole {
    USER,  // 사용자 권한
    ADMIN,  // 관리자 권한
    HOST
}

 

 

2. thymeleaf와 시큐리티를 이용한 html 코드 노출 제한

참고 블로그 : https://dev-gorany.tistory.com/139?category=901854

+ Recent posts