I am using Spring and Spring-Security in a Vaadin application.
I want to check if the user has a certain role using SecurityContextHolderAwareRequestWrapper.isUserInRole(...) but cannot figure out how to get a reference to the wrapper (I tried injecting this using @Autowired, NB: I did not manually configure an instance of it as I believe the DelegatingFilterProxy is already doing this behind the scenes).
This stack overflow issue provided me with the solution, but I cannot uncover how to access or instantiate the wrapper properly.
My other alternative is to access the SecurityContext directly and iterate though the GrantedAuthorities as per the other suggestions in the linked SO issue.
How should I access/instantiate the wrapper?