Author: rajith
Date: Tue Sep 30 09:46:21 2008
New Revision: 700524

URL: http://svn.apache.org/viewvc?rev=700524&view=rev
Log:
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>"


Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/acl/Acl.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/acl/AclData.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/acl/AclReader.cpp

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/acl/Acl.h
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/acl/Acl.h?rev=700524&r1=700523&r2=700524&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/acl/Acl.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/acl/Acl.h Tue Sep 30 09:46:21 2008
@@ -67,7 +67,7 @@
    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();

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/acl/AclData.h
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/acl/AclData.h?rev=700524&r1=700523&r2=700524&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/acl/AclData.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/acl/AclData.h Tue Sep 30 09:46:21 
2008
@@ -57,7 +57,7 @@
    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);
   

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/acl/AclReader.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/acl/AclReader.cpp?rev=700524&r1=700523&r2=700524&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/acl/AclReader.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/acl/AclReader.cpp Tue Sep 30 
09:46:21 2008
@@ -402,9 +402,11 @@
     }
 
     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;
         }


Reply via email to