Have a look at what ServiceContainerHelper.getCurrentServiceContainer() does. It's a simple utility method that should not be public. The exact same code can be added to this class or to a package protected SecurityActions class in this package.