Hi,
Is it not possible to combine @CommandHandler and @PreAuthorize(...)
annotations on a method?
When I do, I get a
java.lang.ClassFormatError: Duplicate method name&signature in class
file no/origin/axon/TestCommandHandler$$EnhancerByCGLIB$$ff55cf57_2$
$Enhanceraxon$$fc6cc56f
It would be nice to be able to authorize commandhandlers.
public class TestCommandHandler {
@Autowired
private EventBus eventBus;
@CommandHandler
@PreAuthorize("hasRole('ROLE_ADMIN')")
public Integer handle(TestCommand command) {
TestEvent event = new TestEvent();
eventBus.publish(event);
return 9;
}
}
Geir