Search in sources :

Example 1 with ACLProviderEntry

use of org.jboss.security.acl.config.ACLProviderEntry in project wildfly by wildfly.

the class SecurityDomainAdd method processACL.

private boolean processACL(OperationContext context, String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy) throws OperationFailedException {
    node = peek(node, ACL, CLASSIC, ACL_MODULE);
    if (node == null) {
        return false;
    }
    ACLInfo aclInfo = new ACLInfo(securityDomain);
    for (Property moduleProperty : node.asPropertyList()) {
        ModelNode module = moduleProperty.getValue();
        String codeName = LoginModuleResourceDefinition.CODE.resolveModelAttribute(context, module).asString();
        String flag = LoginModuleResourceDefinition.FLAG.resolveModelAttribute(context, module).asString();
        ControlFlag controlFlag = ControlFlag.valueOf(flag);
        Map<String, Object> options = extractOptions(context, module);
        ACLProviderEntry entry = new ACLProviderEntry(codeName, options);
        entry.setControlFlag(controlFlag);
        aclInfo.add(entry);
        ModelNode moduleName = LoginModuleResourceDefinition.MODULE.resolveModelAttribute(context, module);
        if (moduleName.isDefined() && !moduleName.asString().isEmpty()) {
            aclInfo.addJBossModuleName(moduleName.asString());
        } else {
            aclInfo.addJBossModuleName(DEFAULT_MODULE);
        }
    }
    applicationPolicy.setAclInfo(aclInfo);
    return true;
}
Also used : ACLInfo(org.jboss.security.config.ACLInfo) ACLProviderEntry(org.jboss.security.acl.config.ACLProviderEntry) ModelNode(org.jboss.dmr.ModelNode) Property(org.jboss.dmr.Property) ControlFlag(org.jboss.security.config.ControlFlag) LoginModuleControlFlag(javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag)

Aggregations

LoginModuleControlFlag (javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag)1 ModelNode (org.jboss.dmr.ModelNode)1 Property (org.jboss.dmr.Property)1 ACLProviderEntry (org.jboss.security.acl.config.ACLProviderEntry)1 ACLInfo (org.jboss.security.config.ACLInfo)1 ControlFlag (org.jboss.security.config.ControlFlag)1