From 6298f81a7806ea18c824d06cf4a82e2e8c985e21 Mon Sep 17 00:00:00 2001 From: "Charles E. Rolke" Date: Fri, 24 Aug 2012 21:50:59 +0000 Subject: QPID-4249 TopicExchange binding lookup for all routing keys git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1377130 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/acl/AclData.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'cpp/src/qpid/acl/AclData.cpp') diff --git a/cpp/src/qpid/acl/AclData.cpp b/cpp/src/qpid/acl/AclData.cpp index 6994de2898..ac97e53b14 100644 --- a/cpp/src/qpid/acl/AclData.cpp +++ b/cpp/src/qpid/acl/AclData.cpp @@ -241,14 +241,31 @@ namespace acl { default: bool result; if ((SPECPROP_ALTERNATE == rulePropMapItr->first && rsItr->ruleHasUserSub[PROP_ALTERNATE]) || - (SPECPROP_ROUTINGKEY == rulePropMapItr->first && rsItr->ruleHasUserSub[PROP_ROUTINGKEY]) || (SPECPROP_QUEUENAME == rulePropMapItr->first && rsItr->ruleHasUserSub[PROP_QUEUENAME])) { // These properties are allowed to have username substitution std::string sName(rulePropMapItr->second); substituteUserId(sName, id); result = matchProp(sName, lookupParamItr->second); - } else { + } + else if (SPECPROP_ROUTINGKEY == rulePropMapItr->first) + { + // Routing key is allowed to have username substitution + // and it gets topic exchange matching + if (rsItr->ruleHasUserSub[PROP_ROUTINGKEY]) + { + std::string sKey(lookupParamItr->second); + substituteKeywords(sKey, id); + result = rsItr->matchRoutingKey(sKey); + } + else + { + result = rsItr->matchRoutingKey(lookupParamItr->second); + } + } + else + { + // Rules without substitution result = matchProp(rulePropMapItr->second, lookupParamItr->second); } -- cgit v1.2.1