}
this.principalRoleMapper = principalRoleMapper;
Thread currentThread = Thread.currentThread();
ClassLoader oldClassLoader = currentThread.getContextClassLoader();
currentThread.setContextClassLoader(cl);
PolicyConfigurationFactory policyConfigurationFactory;
try {
policyConfigurationFactory = PolicyConfigurationFactory.getPolicyConfigurationFactory();
} finally {
currentThread.setContextClassLoader(oldClassLoader);
}
for (Map.Entry<String, ComponentPermissions> entry : contextIdToPermissionsMap.entrySet()) {
String contextID = entry.getKey();
ComponentPermissions componentPermissions = entry.getValue();
PolicyConfiguration policyConfiguration = policyConfigurationFactory.getPolicyConfiguration(contextID, true);
contextIdToPolicyConfigurationMap.put(contextID, policyConfiguration);
policyConfiguration.addToExcludedPolicy(componentPermissions.getExcludedPermissions());
policyConfiguration.addToUncheckedPolicy(componentPermissions.getUncheckedPermissions());
for (Map.Entry<String, PermissionCollection> roleEntry : componentPermissions.getRolePermissions().entrySet()) {
String roleName = roleEntry.getKey();