mirror of
https://github.com/anope/anope.git
synced 2026-07-10 10:03:14 +02:00
Change cs_xop access check to use command order
This commit is contained in:
@@ -121,7 +121,10 @@ class CommandCSXOP : public Command
|
||||
const ChanAccess *highest = access.Highest();
|
||||
bool override = false;
|
||||
|
||||
if ((!access.founder && !access.HasPriv("ACCESS_CHANGE")) || ((!highest || *highest <= tmp_access) && !access.founder))
|
||||
std::vector<Anope::string>::iterator cmd_it = std::find(order.begin(), order.end(), source.command.upper()),
|
||||
access_it = highest ? std::find(order.begin(), order.end(), XOPChanAccess::DetermineLevel(highest)) : order.end();
|
||||
|
||||
if (!access.founder && (!access.HasPriv("ACCESS_CHANGE") || cmd_it <= access_it))
|
||||
{
|
||||
if (source.HasPriv("chanserv/access/modify"))
|
||||
override = true;
|
||||
@@ -260,7 +263,10 @@ class CommandCSXOP : public Command
|
||||
}
|
||||
}
|
||||
|
||||
if ((!mask.equals_ci(nc->display) && !access.HasPriv("ACCESS_CHANGE") && !access.founder) || ((!highest || tmp_access >= *highest) && !access.founder))
|
||||
std::vector<Anope::string>::iterator cmd_it = std::find(order.begin(), order.end(), source.command.upper()),
|
||||
access_it = highest ? std::find(order.begin(), order.end(), XOPChanAccess::DetermineLevel(highest)) : order.end();
|
||||
|
||||
if (!mask.equals_ci(nc->display) && !access.founder && (!access.HasPriv("ACCESS_CHANGE") || cmd_it <= access_it))
|
||||
{
|
||||
if (source.HasPriv("chanserv/access/modify"))
|
||||
override = true;
|
||||
|
||||
Reference in New Issue
Block a user