You can access the Spring Security context provided that remote calls are not involved, but you cannot directly use any of the Spring security features that require proxying the object.
You can use Spring beans at your servlet level (by delegating the same interfaces as EJB and delegate to them), and apply protection to them. It will also allow you to get away from EJB if you want to.
Another alternative would be to consider Spring Security AspectJ support, which should work with EJB.
source share