Package org.jboss.ballroom.client.rbac

Examples of org.jboss.ballroom.client.rbac.Constraints


                            {
                                Property acl = properties.get(0);
                                assert acl.getName().equals("default");   //TODO: overrides ...
                                ModelNode model = acl.getValue();

                                Constraints c = new Constraints();

                                if(model.hasDefined("address")
                                        && model.get("address").asBoolean()==false)
                                {
                                    c.setAddress(false);
                                }
                                else
                                {

                                    c.setReadConfig(model.get("read-config").asBoolean());
                                    c.setWriteConfig(model.get("write-config").asBoolean());
                                    c.setReadRuntime(model.get("read-runtime").asBoolean());
                                    c.setWriteRuntime(model.get("write-runtime").asBoolean());

                                }

                                // TODO: attribute constraints
View Full Code Here


        if(accessControl.isDefined() && accessControl.hasDefined(DEFAULT)) // TODO: overrides ...
        {
            ModelNode model = accessControl.get(DEFAULT);

            Constraints c = new Constraints();

            if(model.hasDefined(ADDRESS)
                    && model.get(ADDRESS).asBoolean()==false)
            {
                c.setAddress(false);
            }
            else
            {

                c.setReadConfig(model.get(READ_CONFIG).asBoolean());
                c.setWriteConfig(model.get(WRITE_CONFIG).asBoolean());
                c.setReadRuntime(model.get(READ_RUNTIME).asBoolean());
                c.setWriteRuntime(model.get(WRITE_RUNTIME).asBoolean());

            }

            // attribute constraints

            if(model.hasDefined(ATTRIBUTES))
            {
                List<Property> attributes = model.get(ATTRIBUTES).asPropertyList();

                for(Property att : attributes)
                {
                    ModelNode attConstraintModel = att.getValue();
                    // config access
                    if(attConstraintModel.hasDefined(READ_CONFIG))
                    {
                        c.setAttributeRead(att.getName(), attConstraintModel.get(READ_CONFIG).asBoolean());
                        c.setAttributeWrite(att.getName(), attConstraintModel.get(WRITE_CONFIG).asBoolean());
                    }

                    // runtime access
                    else
                    {
                        c.setAttributeRead(att.getName(), attConstraintModel.get(READ_RUNTIME).asBoolean());
                        c.setAttributeWrite(att.getName(), attConstraintModel.get(WRITE_RUNTIME).asBoolean());
                    }
                }
            }

            context.updateResourceConstraints(resourceAddress, c);
View Full Code Here

TOP

Related Classes of org.jboss.ballroom.client.rbac.Constraints

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.