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:23:42 UTC
svn commit: r1503646 -
/cxf/branches/2.7.x-fixes/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java
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