1
0
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:
Adam
2013-11-01 04:58:38 -04:00
parent c8db362bca
commit 4ee9021adb
4 changed files with 49 additions and 16 deletions
+5 -6
View File
@@ -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