ClassLoader tcc = hierarchy.getCommonClassLoader();
Thread.currentThread().setContextClassLoader(tcc);
policyLoader.loadPolicy();
WebSecurityManagerFactory wsmf =habitat.getComponent(WebSecurityManagerFactory.class);
// this should create all permissions
wsmf.createManager(wbd,true,serverContext);
// for an application the securityRoleMapper should already be
// created. I am just creating the web permissions and handing
// it to the security component.
name = WebSecurityManager.getContextID(wbd);
SecurityUtil.generatePolicyFile(name);