diff options
author | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-15 15:24:12 +0000 |
---|---|---|
committer | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-15 15:24:12 +0000 |
commit | c8aae1c6ee39b7a2bf3a3f8b03798aa4821f85c5 (patch) | |
tree | 203883c7b862791a31be022bcf9398041c826828 | |
parent | 92170818ffd03887b60759f8cb729454204678a7 (diff) |
Implement opertype methods for priv/command access.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2069 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | src/opertype.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/opertype.cpp b/src/opertype.cpp index a90ac9de5..7e93d1925 100644 --- a/src/opertype.cpp +++ b/src/opertype.cpp @@ -17,12 +17,28 @@ OperType::OperType(const std::string &nname) : name(nname) bool OperType::HasCommand(const std::string &cmdstr) const { - + for (std::list<std::string>::const_iterator it = this->commands.begin(); it != this->commands.end(); it++) + { + if (Anope::Match(cmdstr, *it)) + { + return true; + } + } + + return false; } bool OperType::HasPriv(const std::string &privstr) const { - + for (std::list<std::string>::const_iterator it = this->privs.begin(); it != this->privs.end(); it++) + { + if (Anope::Match(privstr, *it)) + { + return true; + } + } + + return false; } void OperType::AddCommand(const std::string &cmdstr) |