Package org.jboss.security.config

Examples of org.jboss.security.config.ACLInfo


    private boolean processACL(String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy) {
        node = peek(node, ACL, CLASSIC);
        if (node == null)
            return false;

        ACLInfo aclInfo = new ACLInfo(securityDomain);
        List<ModelNode> modules = node.get(ACL_MODULES).asList();
        for (ModelNode module : modules) {
            String codeName = module.require(CODE).asString();
            ControlFlag controlFlag = ControlFlag.valueOf(module.require(FLAG).asString());
            Map<String, Object> options = extractOptions(module);
            ACLProviderEntry entry = new ACLProviderEntry(codeName, options);
            entry.setControlFlag(controlFlag);
            aclInfo.add(entry);

            String moduleName = module.get(MODULE).asString();
            if(module.hasDefined(MODULE) && moduleName != null &&  moduleName.length() > 0 ) {
                aclInfo.setJBossModuleName(moduleName);
            }

        }
        applicationPolicy.setAclInfo(aclInfo);
        return true;
View Full Code Here


      assertEquals("Number of options = 2", 2, authzoptions.size());
      assertEquals("name=authz", "authz", authzoptions.get("name"));
      assertEquals("succeed=true", "true", authzoptions.get("succeed"));

      // ACL (instance-based authorization)
      ACLInfo aclInfo = completeConfig.getAclInfo();
      assertNotNull("Unexpected null ACLInfo found", aclInfo);
      ACLProviderEntry[] aclEntries = aclInfo.getACLProviderEntry();
      assertNotNull("Unexpected null set of acl entries", aclEntries);
      assertEquals("Invalid number of acl entries", 2, aclEntries.length);
      // first entry should be org.jboss.security.authz.ACLModule1.
      Assert.assertEquals("org.jboss.security.authz.ACLModule1", aclEntries[0].getAclProviderName());
      Assert.assertEquals("REQUIRED", aclEntries[0].getControlFlag().toString());
View Full Code Here

      AuthorizationInfo azi = completeConfig.getAuthorizationInfo();
      assertNotNull("AuthorizationInfo is not null", azi);
      assertEquals("3 authz modules", 3, azi.getModuleEntries().size());

      // ACL
      ACLInfo aclInfo = completeConfig.getAclInfo();
      assertNotNull("Unexpected null ACLInfo", aclInfo);
      assertEquals("Unexpected number of acl modules", 3, aclInfo.getModuleEntries().size());

      // Role Mapping
      MappingInfo mappingInfo = completeConfig.getMappingInfo(MappingType.ROLE.toString());
      assertNotNull("MappingInfo is not null", mappingInfo);
      // we expect 2 modules because one has been configured as a mapping of type "role"
View Full Code Here

        }

        // acl
        node = operation.get(Element.ACL.getLocalName());
        if (node.isDefined()) {
            ACLInfo aclInfo = new ACLInfo(securityDomain);
            modules = node.asList();
            for (ModelNode module : modules) {
                String codeName = module.require(Attribute.CODE.getLocalName()).asString();
                ControlFlag controlFlag = ControlFlag.valueOf(module.require(Attribute.FLAG.getLocalName()).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());
                    }
                }
                ACLProviderEntry entry = new ACLProviderEntry(codeName, options);
                entry.setControlFlag(controlFlag);
                aclInfo.add(entry);

            }
            applicationPolicy.setAclInfo(aclInfo);
        }
View Full Code Here

        // acl
        node = operation.get(ACL);
        if (node.isDefined()) {
            if (applicationPolicy == null)
                applicationPolicy = new ApplicationPolicy(securityDomain);
            ACLInfo aclInfo = new ACLInfo(securityDomain);
            modules = node.asList();
            for (ModelNode module : modules) {
                String codeName = module.require(CODE).asString();
                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());
                    }
                }
                ACLProviderEntry entry = new ACLProviderEntry(codeName, options);
                entry.setControlFlag(controlFlag);
                aclInfo.add(entry);

            }
            applicationPolicy.setAclInfo(aclInfo);
        }
View Full Code Here

        }

        // acl
        node = operation.get(Element.ACL.getLocalName());
        if (node.isDefined()) {
            ACLInfo aclInfo = new ACLInfo(securityDomain);
            modules = node.asList();
            for (ModelNode module : modules) {
                String codeName = module.require(Attribute.CODE.getLocalName()).asString();
                ControlFlag controlFlag = ControlFlag.valueOf(module.require(Attribute.FLAG.getLocalName()).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());
                    }
                }
                ACLProviderEntry entry = new ACLProviderEntry(codeName, options);
                entry.setControlFlag(controlFlag);
                aclInfo.add(entry);

            }
            applicationPolicy.setAclInfo(aclInfo);
        }
View Full Code Here

      {
         child = new AuthorizationInfo(aPolicy.getName());
      }
      else if (child == null && "acl".equals(localName))
      {
         child = new ACLInfo(aPolicy.getName());
      }
      else if (child == null && "mapping".equals(localName))
      {
         child = new MappingInfo(aPolicy.getName());
      }
View Full Code Here

      ClassLoader tcl = Thread.currentThread().getContextClassLoader();
      registration.registerPolicy("ID", PolicyRegistration.ACL, tcl.getResourceAsStream("config/jboss-acl.xml"));

      // create an application policy that contains an ACL configuration.
      ApplicationPolicy ap = new ApplicationPolicy("test-acl");
      ACLInfo aclInfo = new ACLInfo("test-acl");
      // set the TestACLProvider with the PolicyRegistration created above.
      Map<String, Object> options = new HashMap<String, Object>();
      options.put("policyRegistration", registration);
      ACLProviderEntry ame = new ACLProviderEntry(TestACLProvider.class.getName(), options);
      aclInfo.add(ame);
      ap.setAclInfo(aclInfo);
      // register the application policy.
      SecurityConfiguration.addApplicationPolicy(ap);
   }
View Full Code Here

    private boolean processACL(String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy) {
        node = peek(node, ACL, CLASSIC);
        if (node == null)
            return false;

        ACLInfo aclInfo = new ACLInfo(securityDomain);
        List<ModelNode> modules = node.get(ACL_MODULES).asList();
        for (ModelNode module : modules) {
            String codeName = module.require(CODE).asString();
            ControlFlag controlFlag = ControlFlag.valueOf(module.require(FLAG).asString());
            Map<String, Object> options = extractOptions(module);
            ACLProviderEntry entry = new ACLProviderEntry(codeName, options);
            entry.setControlFlag(controlFlag);
            aclInfo.add(entry);

        }
        applicationPolicy.setAclInfo(aclInfo);
        return true;
    }
View Full Code Here

    private boolean processACL(String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy) {
        node = peek(node, ACL, CLASSIC);
        if (node == null)
            return false;

        ACLInfo aclInfo = new ACLInfo(securityDomain);
        List<ModelNode> modules = node.get(ACL_MODULES).asList();
        for (ModelNode module : modules) {
            String codeName = module.require(CODE).asString();
            ControlFlag controlFlag = ControlFlag.valueOf(module.require(FLAG).asString());
            Map<String, Object> options = extractOptions(module);
            ACLProviderEntry entry = new ACLProviderEntry(codeName, options);
            entry.setControlFlag(controlFlag);
            aclInfo.add(entry);

            String moduleName = module.get(MODULE).asString();
            if(module.hasDefined(MODULE) && moduleName != null &&  moduleName.length() > 0 ) {
                aclInfo.setJBossModuleName(moduleName);
            }

        }
        applicationPolicy.setAclInfo(aclInfo);
        return true;
View Full Code Here

TOP

Related Classes of org.jboss.security.config.ACLInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.