mirror of
https://github.com/anope/anope.git
synced 2026-06-28 09:16:38 +02:00
Compare access entries created with the levels access system by access level and not by privilege set, as two entries can have the same privset but different levels, but still represent two different levels of access. This prevented users from adding other users at a lower access level when that level had the same privset as them. Spotted by TSG.
This commit is contained in:
+5
-6
@@ -363,12 +363,11 @@ bool AccessGroup::HasPriv(const Anope::string &name) const
|
||||
|
||||
const ChanAccess *AccessGroup::Highest() const
|
||||
{
|
||||
const std::vector<Privilege> &privs = PrivilegeManager::GetPrivileges();
|
||||
for (unsigned i = privs.size(); i > 0; --i)
|
||||
for (unsigned j = this->size(); j > 0; --j)
|
||||
if (this->at(j - 1)->HasPriv(privs[i - 1].name))
|
||||
return this->at(j - 1);
|
||||
return NULL;
|
||||
ChanAccess *highest = NULL;
|
||||
for (unsigned i = 0; i < this->size(); ++i)
|
||||
if (highest == NULL || *this->at(i) > *highest)
|
||||
highest = this->at(i);
|
||||
return highest;
|
||||
}
|
||||
|
||||
bool AccessGroup::operator>(const AccessGroup &other) const
|
||||
|
||||
Reference in New Issue
Block a user