package Viettel.authen.controller; import org.springframework.context.annotation.Role; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @PreAuthorize("hasRole('ROLE_USER')") public class HelloController { @RequestMapping({ "/hello" }) public String firstPage() { return "Hello World"; } }