I would like to use that repository in this class, but when I put a stereotype like @Component, I get an error from the IDE:
Could not autowire. No beans of 'Authentication' type found.
public class CustomMethodSecurityExpressionRoot extends SecurityExpressionRoot implements MethodSecurityExpressionOperations {
@Autowired
private FlatRepository flatRepository;
public CustomMethodSecurityExpressionRoot(Authentication authentication) {
super(authentication);
}
}