// authorization
node = operation.get(AUTHORIZATION);
if (node.isDefined()) {
if (applicationPolicy == null)
applicationPolicy = new ApplicationPolicy(securityDomain);
AuthorizationInfo authorizationInfo = new AuthorizationInfo(securityDomain);
modules = node.asList();
for (ModelNode module : modules) {
String codeName = module.require(CODE).asString();
if (ModulesMap.AUTHORIZATION_MAP.containsKey(codeName))
codeName = ModulesMap.AUTHORIZATION_MAP.get(codeName);
ControlFlag controlFlag = ControlFlag.valueOf(module.require(FLAG).asString());
Map<String, Object> options = new HashMap<String, Object>();
if (module.hasDefined(MODULE_OPTIONS)) {
for (Property prop : module.get(MODULE_OPTIONS).asPropertyList()) {
options.put(prop.getName(), prop.getValue().asString());
}
}
AuthorizationModuleEntry entry = new AuthorizationModuleEntry(codeName, options);
entry.setControlFlag(controlFlag);
authorizationInfo.add(entry);
}
applicationPolicy.setAuthorizationInfo(authorizationInfo);
}