diff options
| author | Kim van der Riet <kpvdr@apache.org> | 2008-08-01 21:07:20 +0000 |
|---|---|---|
| committer | Kim van der Riet <kpvdr@apache.org> | 2008-08-01 21:07:20 +0000 |
| commit | 8ce6a530df25eae7ebf28b9897e0c6a922a7b3a4 (patch) | |
| tree | b5630846706d191bab69f3d48e41139b9d79dd1c /cpp/src/qpid/acl/Acl.cpp | |
| parent | 2511200dc9f3e75d2f6979b33fd94301e9b117cd (diff) | |
| download | qpid-python-8ce6a530df25eae7ebf28b9897e0c6a922a7b3a4.tar.gz | |
Initial framework for ACL reader
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@681824 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/acl/Acl.cpp')
| -rw-r--r-- | cpp/src/qpid/acl/Acl.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/cpp/src/qpid/acl/Acl.cpp b/cpp/src/qpid/acl/Acl.cpp index 9f6917a006..2e13aac7a6 100644 --- a/cpp/src/qpid/acl/Acl.cpp +++ b/cpp/src/qpid/acl/Acl.cpp @@ -72,6 +72,9 @@ using namespace std; /*params*/) { if (aclValues.noEnforce) return true; + boost::shared_ptr<AclData> dataLocal = data; //rcu copy + + // only use dataLocal here... // add real ACL check here... AclResult aclreslt = ALLOWLOG; // hack to test, set based on real decision. @@ -83,6 +86,9 @@ using namespace std; bool Acl::authorise(std::string id, acl::Action action, acl::ObjectType objType, std::string ExchangeName, std::string /*RoutingKey*/) { if (aclValues.noEnforce) return true; + boost::shared_ptr<AclData> dataLocal = data; //rcu copy + + // only use dataLocal here... // add real ACL check here... AclResult aclreslt = ALLOWLOG; // hack to test, set based on real decision. @@ -113,8 +119,15 @@ using namespace std; bool Acl::readAclFile() { // only set transferAcl = true if a rule implies the use of ACL on transfer, else keep false for permormance reasons. - - + return readAclFile(aclValues.aclFile); + } + + bool Acl::readAclFile(std::string aclFile) { + boost::shared_ptr<AclData> d(new AclData); + if (AclReader::read(aclFile, d)) + return false; + + data = d; return true; } |
