1
0
mirror of https://github.com/anope/anope.git synced 2026-07-02 03:26:39 +02:00

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

This commit is contained in:
Adam
2011-08-09 04:38:35 -04:00
parent cb7435982c
commit 8116ad9b28
4 changed files with 20 additions and 4 deletions
+16
View File
@@ -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)),