mirror of
https://github.com/anope/anope.git
synced 2026-06-29 07:16:39 +02:00
Hopefully sort this AccessGroup::HasPriv once and for all
This commit is contained in:
+12
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user