Ideally the way this works is that we would just pass a security manager to this function rather than initializing some configuration inside of a static utility like this.

The model going forward with SparkConf is that all components should configure themselves via a SparkConf and we shouldn't directly use system properties or thread locals to do various configurations.

So the ideal way this would work is that we create a single SecurityManager inside the Master and Worker classes (based on the SparkConf they each create) and then that gets passed into all calls of these static utilities. For the UI's inside of an active SparkContext we'd just pass `sc.env.securityManager`. 

The downside is it will make using these functions a little clunkier because really you need a reference to the security manager for every handler you create. That's a bit clunkier but ultimately better (I think). Doing this initialization inside of each servlet isn't so good in the SparkConf world.