summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-15 15:24:12 +0000
committerrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-15 15:24:12 +0000
commitc8aae1c6ee39b7a2bf3a3f8b03798aa4821f85c5 (patch)
tree203883c7b862791a31be022bcf9398041c826828 /src
parent92170818ffd03887b60759f8cb729454204678a7 (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
Diffstat (limited to 'src')
-rw-r--r--src/opertype.cpp20
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)