Rob Winch opened SPR-14174 and commented
It would be nice if Spring's AbstractAdvisorAutoProxyCreator would support package scope methods. This has become increasingly important for Boot style applications which often use default methods. For example, the controller below is not secured due to the fact that package scope method is used:
@RestController
public class AdminController {
@PreAuthorize("hasRole('ADMIN')")
@RequestMapping("/admin/")
String index() {
return "Admin";
}
}
Right now this appears to be blocked by the fact that AopUtils.canApply only checks public methods since it uses methods = clazz.getMethods()
Referenced from: commits 9991122