summaryrefslogtreecommitdiff
path: root/src/access.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-08-09 04:38:35 -0400
committerAdam <Adam@anope.org>2011-08-09 04:38:35 -0400
commit8116ad9b2885b69680bd3bed6b784d434b223a5b (patch)
tree22e8a172c2135144d6976649ad46145896d81cc1 /src/access.cpp
parentcb7435982c0e04268439f38fb4341ecbe338b625 (diff)
Added forgotten founder checks to cs_access, fixed fantasy replies to come from the right service, and fixed the accessgroup operators to acount for founder/superadmin
Diffstat (limited to 'src/access.cpp')
-rw-r--r--src/access.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/access.cpp b/src/access.cpp
index 61536ed81..3559a8209 100644
--- a/src/access.cpp
+++ b/src/access.cpp
@@ -115,6 +115,10 @@ ChanAccess *AccessGroup::Highest() const
bool AccessGroup::operator>(const AccessGroup &other) const
{
+ if (this->SuperAdmin)
+ return true;
+ else if (this->Founder && !other.Founder)
+ return true;
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;
@@ -123,6 +127,10 @@ bool AccessGroup::operator>(const AccessGroup &other) const
bool AccessGroup::operator<(const AccessGroup &other) const
{
+ if (other.SuperAdmin)
+ return false;
+ else if (other.Founder && !this->Founder)
+ return true;
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;
@@ -131,6 +139,10 @@ bool AccessGroup::operator<(const AccessGroup &other) const
bool AccessGroup::operator>=(const AccessGroup &other) const
{
+ if (this->SuperAdmin)
+ return true;
+ else if (this->Founder)
+ return true;
for (size_t i = CA_SIZE; i > 0; --i)
{
bool this_p = this->HasPriv(static_cast<ChannelAccess>(i - 1)),
@@ -145,6 +157,10 @@ bool AccessGroup::operator>=(const AccessGroup &other) const
bool AccessGroup::operator<=(const AccessGroup &other) const
{
+ if (other.SuperAdmin)
+ return true;
+ else if (other.Founder)
+ return true;
for (size_t i = CA_SIZE; i > 0; --i)
{
bool this_p = this->HasPriv(static_cast<ChannelAccess>(i - 1)),