-
Improvement
-
Resolution: Fixed
-
Minor
Initially suggested by jglick when I asked a question on the developer group https://groups.google.com/forum/?fromgroups=#!topic/jenkinsci-dev/H8gAZcDOqgc -
Creates a delegating ExecutorService implementation whose submit and related methods capture the current SecurityContext
and then wrap the task in a block that resets the context afterwards. Using this one could simply write:
SomeUtilityClass.wrapExecutorWithSecurity(service).submit(new Callable<Void>() { public Void call() throws Exception { Jenkins.getInstance().getItem(whatever); // should work return null; } });