Closed
Description
We should look into how to provide native hints for bean methods used inside Method Security annotations.
Currently, in order to make this work:
@Component
class Authz {
boolean check(Authentication authentication, String id, String permission) {
return "admin".equals(authentication.getName());
}
}
@PreAuthorize("@authz.check(authentication, #id, 'read')")
String findById(String id) {
}
We need to register hints:
@Override
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
hints.reflection().registerType(Authz.class, MemberCategory.INVOKE_DECLARED_METHODS);
}
Related to