diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2008-09-30 16:46:21 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2008-09-30 16:46:21 +0000 |
| commit | aa5bbe424e19fb9640bac46adecb57fb30b23337 (patch) | |
| tree | 10c4ab9b29b38df0bc14736810c36bf30c311be7 /qpid/cpp | |
| parent | 37cc725234d88e7b0c4d9d97b3ac631f2b519b18 (diff) | |
| download | qpid-python-aa5bbe424e19fb9640bac46adecb57fb30b23337.tar.gz | |
Added a default value for param in authorize and lookup methods in Acl.h and AclData.h.
This enables the user to call authorize and lookup safely without having to pass params.
Fixed a minor bug in AclReader.cpp to allow the following permission
"acl allow <group or user> all <object_type>"
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@700524 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/src/qpid/acl/Acl.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/acl/AclData.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/acl/AclReader.cpp | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/qpid/cpp/src/qpid/acl/Acl.h b/qpid/cpp/src/qpid/acl/Acl.h index b072d24cc0..fe1c1500bb 100644 --- a/qpid/cpp/src/qpid/acl/Acl.h +++ b/qpid/cpp/src/qpid/acl/Acl.h @@ -67,7 +67,7 @@ public: inline virtual bool doTransferAcl() {return transferAcl;}; // create specilied authorise methods for cases that need faster matching as needed. - virtual bool authorise(const std::string& id, const Action& action, const ObjectType& objType, const std::string& name, std::map<Property, std::string>* params); + virtual bool authorise(const std::string& id, const Action& action, const ObjectType& objType, const std::string& name, std::map<Property, std::string>* params=0); virtual bool authorise(const std::string& id, const Action& action, const ObjectType& objType, const std::string& ExchangeName,const std::string& RoutingKey); virtual ~Acl(); diff --git a/qpid/cpp/src/qpid/acl/AclData.h b/qpid/cpp/src/qpid/acl/AclData.h index a2809616fe..249c3523eb 100644 --- a/qpid/cpp/src/qpid/acl/AclData.h +++ b/qpid/cpp/src/qpid/acl/AclData.h @@ -57,7 +57,7 @@ public: qpid::acl::AclResult decisionMode; // determines if the rule set is an deny or accept basis. bool transferAcl; - AclResult lookup(const std::string& id, const Action& action, const ObjectType& objType, const std::string& name, std::map<Property, std::string>* params); + AclResult lookup(const std::string& id, const Action& action, const ObjectType& objType, const std::string& name, std::map<Property, std::string>* params=0); AclResult lookup(const std::string& id, const Action& action, const ObjectType& objType, const std::string& ExchangeName, const std::string& RoutingKey); AclResult getACLResult(bool logOnly, bool log); diff --git a/qpid/cpp/src/qpid/acl/AclReader.cpp b/qpid/cpp/src/qpid/acl/AclReader.cpp index 0ad92a2243..c27f1a24bf 100644 --- a/qpid/cpp/src/qpid/acl/AclReader.cpp +++ b/qpid/cpp/src/qpid/acl/AclReader.cpp @@ -402,9 +402,11 @@ bool AclReader::processAclLine(tokList& toks) { } bool actionAllFlag = toks[3].compare("all") == 0; + bool userAllFlag = toks[2].compare("all") == 0; Action action; if (actionAllFlag) { - if (toksSize > 4) { + + if (userAllFlag && toksSize > 4) { QPID_LOG(error, ACL_FORMAT_ERR_LOG_PREFIX << "Tokens found after action \"all\"."); return false; } |
