I am building an application using App Engine with Jersey. I would like use the annotation @RolesAllowed(Role_user)
who permit to create a filter in the request.
I'm pretty not sure whether you can inject a HttpServletRequest
on top of the ContainerRequestFilter
in jersey but you still can do it programmatically instead of using annotations:
@Override
public ContainerRequest filter(ContainerRequest request) {
if(request.isUserInRole("SOME_ROLE")){
//process some treatement
}
return request;
}
BR.