mirror of
https://github.com/anope/anope.git
synced 2026-06-30 13:25:45 +02:00
Fixed access comparators
This commit is contained in:
+5
-5
@@ -55,14 +55,14 @@ class CoreExport ChanAccess : public Serializable
|
||||
static void unserialize(serialized_data &);
|
||||
|
||||
virtual bool Matches(User *u, NickCore *nc) = 0;
|
||||
virtual bool HasPriv(const Anope::string &name) = 0;
|
||||
virtual bool HasPriv(const Anope::string &name) const = 0;
|
||||
virtual Anope::string Serialize() = 0;
|
||||
virtual void Unserialize(const Anope::string &data) = 0;
|
||||
|
||||
bool operator>(ChanAccess &other);
|
||||
bool operator<(ChanAccess &other);
|
||||
bool operator>=(ChanAccess &other);
|
||||
bool operator<=(ChanAccess &other);
|
||||
bool operator>(const ChanAccess &other) const;
|
||||
bool operator<(const ChanAccess &other) const;
|
||||
bool operator>=(const ChanAccess &other) const;
|
||||
bool operator<=(const ChanAccess &other) const;
|
||||
};
|
||||
|
||||
class CoreExport AccessGroup : public std::vector<ChanAccess *>
|
||||
|
||||
@@ -40,7 +40,7 @@ class AccessChanAccess : public ChanAccess
|
||||
return false;
|
||||
}
|
||||
|
||||
bool HasPriv(const Anope::string &name)
|
||||
bool HasPriv(const Anope::string &name) const
|
||||
{
|
||||
return this->ci->GetLevel(name) != ACCESS_INVALID && this->level >= this->ci->GetLevel(name);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class FlagsChanAccess : public ChanAccess
|
||||
return false;
|
||||
}
|
||||
|
||||
bool HasPriv(const Anope::string &priv)
|
||||
bool HasPriv(const Anope::string &priv) const
|
||||
{
|
||||
std::map<Anope::string, char>::iterator it = defaultFlags.find(priv);
|
||||
if (it != defaultFlags.end() && this->flags.count(it->second) > 0)
|
||||
|
||||
@@ -108,7 +108,7 @@ class XOPChanAccess : public ChanAccess
|
||||
return false;
|
||||
}
|
||||
|
||||
bool HasPriv(const Anope::string &priv)
|
||||
bool HasPriv(const Anope::string &priv) const
|
||||
{
|
||||
for (int i = 0; xopAccess[i].type != XOP_UNKNOWN; ++i)
|
||||
{
|
||||
|
||||
+85
-29
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user