private boolean processAuthorization(OperationContext context, String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy)
throws OperationFailedException {
node = peek(node, AUTHORIZATION, CLASSIC, POLICY_MODULE);
if (node == null) { return false; }
AuthorizationInfo authzInfo = new AuthorizationInfo(securityDomain);
for (Property moduleProperty : node.asPropertyList()) {
ModelNode module = moduleProperty.getValue();
String codeName = extractCode(context, module, ModulesMap.AUTHORIZATION_MAP);
String flag = LoginModuleResourceDefinition.FLAG.resolveModelAttribute(context, module).asString();
ControlFlag controlFlag = ControlFlag.valueOf(flag);
Map<String, Object> options = extractOptions(context, module);
AuthorizationModuleEntry authzModuleEntry = new AuthorizationModuleEntry(codeName, options);
authzModuleEntry.setControlFlag(controlFlag);
authzInfo.add(authzModuleEntry);
ModelNode moduleName = LoginModuleResourceDefinition.MODULE.resolveModelAttribute(context, module);
if (moduleName.isDefined() && moduleName.asString().length() > 0) {
authzInfo.setJBossModuleName(moduleName.asString());
}
}
applicationPolicy.setAuthorizationInfo(authzInfo);
return true;