You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2013/07/16 12:12:33 UTC

svn commit: r1503645 - /cxf/trunk/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java

Author: coheigea
Date: Tue Jul 16 10:12:33 2013
New Revision: 1503645

URL: http://svn.apache.org/r1503645
Log:
Send the Resources as a single Attribute

Modified:
    cxf/trunk/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java

Modified: cxf/trunk/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java?rev=1503645&r1=1503644&r2=1503645&view=diff
==============================================================================
--- cxf/trunk/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java (original)
+++ cxf/trunk/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java Tue Jul 16 10:12:33 2013
@@ -72,12 +72,27 @@ public class DefaultXACMLRequestBuilder 
 
     private ResourceType createResourceType(List<String> resources) {
         List<AttributeType> attributes = new ArrayList<AttributeType>();
+        
+        List<AttributeValueType> resourceAttributes = new ArrayList<AttributeValueType>();
         for (String resource : resources) {
             if (resource != null) {
-                attributes.add(createAttribute(XACMLConstants.RESOURCE_ID, XACMLConstants.XS_STRING, null,
-                                               resource));
+                AttributeValueType resourceAttributeValue = 
+                    RequestComponentBuilder.createAttributeValueType(resource);
+                resourceAttributes.add(resourceAttributeValue);
             }
         }
+
+        if (!resourceAttributes.isEmpty()) {
+            AttributeType resourceAttribute = 
+                createAttribute(
+                    XACMLConstants.RESOURCE_ID,
+                    XACMLConstants.XS_STRING,
+                    null,
+                    resourceAttributes
+                );
+            attributes.add(resourceAttribute);
+        }
+        
         return RequestComponentBuilder.createResourceType(attributes, null);
     }