summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-08-27 17:13:28 -0400
committerAdam <Adam@anope.org>2011-08-27 17:13:28 -0400
commit670c928a9f10c37aca748fe6bd0ddda741f7d7d9 (patch)
treec5b2ef22801ce54fd3d9607ea4429be75352acab /src
parentd07a69278db2b140fdfd839819f2e3baec5218cd (diff)
Tweaked the access operators to allow superadmins to be > channel founders
Diffstat (limited to 'src')
-rw-r--r--src/access.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/access.cpp b/src/access.cpp
index cbe2f2a12..9eb014b56 100644
--- a/src/access.cpp
+++ b/src/access.cpp
@@ -121,8 +121,12 @@ bool AccessGroup::operator>(const AccessGroup &other) const
{
if (this->SuperAdmin)
return true;
+ else if (other.SuperAdmin)
+ return false;
else if (this->Founder && !other.Founder)
return true;
+ else if (!this->Founder && other.Founder)
+ return false;
for (size_t i = CA_SIZE; i > 0; --i)
if (this->HasPriv(static_cast<ChannelAccess>(i - 1)) && !other.HasPriv(static_cast<ChannelAccess>(i - 1)))
return true;
@@ -132,9 +136,13 @@ bool AccessGroup::operator>(const AccessGroup &other) const
bool AccessGroup::operator<(const AccessGroup &other) const
{
if (other.SuperAdmin)
+ return true;
+ else if (this->SuperAdmin)
return false;
else if (other.Founder && !this->Founder)
return true;
+ else if (this->Founder && !other.Founder)
+ return false;
for (size_t i = CA_SIZE; i > 0; --i)
if (!this->HasPriv(static_cast<ChannelAccess>(i - 1)) && other.HasPriv(static_cast<ChannelAccess>(i - 1)))
return true;
@@ -145,8 +153,12 @@ bool AccessGroup::operator>=(const AccessGroup &other) const
{
if (this->SuperAdmin)
return true;
+ else if (other.SuperAdmin)
+ return false;
else if (this->Founder)
return true;
+ else if (other.Founder)
+ return false;
for (size_t i = CA_SIZE; i > 0; --i)
{
bool this_p = this->HasPriv(static_cast<ChannelAccess>(i - 1)),
@@ -163,8 +175,12 @@ bool AccessGroup::operator<=(const AccessGroup &other) const
{
if (other.SuperAdmin)
return true;
+ else if (this->SuperAdmin)
+ return false;
else if (other.Founder)
return true;
+ else if (this->Founder)
+ return false;
for (size_t i = CA_SIZE; i > 0; --i)
{
bool this_p = this->HasPriv(static_cast<ChannelAccess>(i - 1)),