use of org.jboss.security.config.MappingInfo in project wildfly by wildfly.
the class SecurityDomainAdd method processMapping.
private boolean processMapping(OperationContext context, String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy) throws OperationFailedException {
node = peek(node, MAPPING, CLASSIC, MAPPING_MODULE);
if (node == null) {
return false;
}
for (Property moduleProperty : node.asPropertyList()) {
ModelNode module = moduleProperty.getValue();
MappingInfo mappingInfo = new MappingInfo(securityDomain);
String codeName = extractCode(context, module, ModulesMap.MAPPING_MAP);
String mappingType;
if (module.hasDefined(TYPE)) {
mappingType = MappingModuleDefinition.TYPE.resolveModelAttribute(context, module).asString();
} else {
mappingType = MappingType.ROLE.toString();
}
Map<String, Object> options = extractOptions(context, module);
MappingModuleEntry entry = new MappingModuleEntry(codeName, options, mappingType);
mappingInfo.add(entry);
applicationPolicy.setMappingInfo(mappingType, mappingInfo);
ModelNode moduleName = LoginModuleResourceDefinition.MODULE.resolveModelAttribute(context, module);
if (moduleName.isDefined() && !moduleName.asString().isEmpty()) {
mappingInfo.addJBossModuleName(moduleName.asString());
} else {
mappingInfo.addJBossModuleName(DEFAULT_MODULE);
}
}
return true;
}
Aggregations