cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1503645 - /cxf/trunk/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java
Date Tue, 16 Jul 2013 10:12:33 GMT
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);
     }
 



Mime
View raw message