00001 #ifndef QPID_ACL_ACL_H
00002 #define QPID_ACL_ACL_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "qpid/acl/AclReader.h"
00026 #include "qpid/shared_ptr.h"
00027 #include "qpid/RefCounted.h"
00028 #include "qpid/broker/AclModule.h"
00029 #include <map>
00030 #include <string>
00031
00032
00033 namespace qpid {
00034 namespace broker {
00035 class Broker;
00036 }
00037
00038 namespace acl {
00039
00040 struct AclValues {
00041 bool noEnforce;
00042 std::string aclFile;
00043
00044 AclValues() {noEnforce = false; aclFile = "policy.acl"; }
00045 };
00046
00047
00048 class Acl : public broker::AclModule, public RefCounted
00049 {
00050
00051 private:
00052 acl::AclValues aclValues;
00053 broker::Broker* broker;
00054 bool transferAcl;
00055 boost::shared_ptr<AclData> data;
00056
00057
00058 public:
00059 Acl (AclValues& av, broker::Broker& b);
00060
00061 void initialize();
00062
00063 inline virtual bool doTransferAcl() {return transferAcl;};
00064
00065
00066 virtual bool authorise(std::string id, acl::Action action, acl::ObjectType objType, std::string name, std::map<std::string, std::string>* params);
00067 virtual bool authorise(std::string id, acl::Action action, acl::ObjectType objType, std::string ExchangeName, std::string RoutingKey);
00068
00069 virtual ~Acl();
00070 private:
00071 std::string printAction(acl::Action action);
00072 std::string printObjType(acl::ObjectType objType);
00073 bool result(AclResult aclreslt, std::string id, acl::Action action, acl::ObjectType objType, std::string name);
00074 bool readAclFile();
00075 bool readAclFile(std::string aclFile);
00076 };
00077
00078
00079
00080 }}
00081
00082 #endif // QPID_ACL_ACL_H