summaryrefslogtreecommitdiff
path: root/src/access.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-08-09 00:06:44 -0400
committerAdam <Adam@anope.org>2011-08-09 00:06:44 -0400
commit91c3363c1578d24e70d0ed215d6aedc769076f08 (patch)
treec3f77b446225b3d9b52691cabb84b2fd3d10ac62 /src/access.cpp
parentb7542fd6f29b5fec45314dbf65f599c5bd2b3650 (diff)
Hopefully sort this AccessGroup::HasPriv once and for all
Diffstat (limited to 'src/access.cpp')
-rw-r--r--src/access.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/access.cpp b/src/access.cpp
index 07e82159c..61536ed81 100644
--- a/src/access.cpp
+++ b/src/access.cpp
@@ -13,6 +13,12 @@
#include "modules.h"
#include "access.h"
+enum
+{
+ ACCESS_INVALID = -10000,
+ ACCESS_FOUNDER = 10001
+};
+
AccessProvider::AccessProvider(Module *o, const Anope::string &n) : Service(o, n)
{
}
@@ -75,13 +81,18 @@ bool ChanAccess::operator<=(ChanAccess &other)
AccessGroup::AccessGroup() : std::vector<ChanAccess *>()
{
- this->SuperAdmin = false;
+ this->ci = NULL;
+ this->SuperAdmin = this->Founder = false;
}
bool AccessGroup::HasPriv(ChannelAccess priv) const
{
if (this->SuperAdmin)
return true;
+ else if (ci->levels[priv] == ACCESS_INVALID)
+ return false;
+ else if (this->Founder)
+ return true;
for (unsigned i = this->size(); i > 0; --i)
{
ChanAccess *access = this->at(i - 1);