Author: coheigea
Date: Tue Jul 16 10:23:42 2013
New Revision: 1503646

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

Modified:
    
cxf/branches/2.7.x-fixes/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java

Modified: 
cxf/branches/2.7.x-fixes/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java?rev=1503646&r1=1503645&r2=1503646&view=diff
==============================================================================
--- 
cxf/branches/2.7.x-fixes/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java
 (original)
+++ 
cxf/branches/2.7.x-fixes/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java
 Tue Jul 16 10:23:42 2013
@@ -119,20 +119,25 @@ public class DefaultXACMLRequestBuilder 
         
         // Resource
         attributes.clear();
+        List<AttributeValueType> resourceAttributes = new 
ArrayList<AttributeValueType>();
         for (String resource : resources) {
             if (resource != null) {
                 AttributeValueType resourceAttributeValue = 
                     RequestComponentBuilder.createAttributeValueType(resource);
-                AttributeType resourceAttribute = 
-                    RequestComponentBuilder.createAttributeType(
-                            XACMLConstants.RESOURCE_ID,
-                            XACMLConstants.XS_STRING,
-                            null,
-                            Collections.singletonList(resourceAttributeValue)
-                    );
-                attributes.add(resourceAttribute);
+                resourceAttributes.add(resourceAttributeValue);
             }
         }
+        
+        if (!resourceAttributes.isEmpty()) {
+            AttributeType resourceAttribute = 
+                RequestComponentBuilder.createAttributeType(
+                        XACMLConstants.RESOURCE_ID,
+                        XACMLConstants.XS_STRING,
+                        null,
+                        resourceAttributes
+                );
+            attributes.add(resourceAttribute);
+        }
         ResourceType resourceType = 
RequestComponentBuilder.createResourceType(attributes, null);
         
         // Action


Reply via email to