diff options
| author | Adam <Adam@anope.org> | 2011-08-09 01:55:34 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-08-09 01:55:34 -0400 |
| commit | 776583a665fdc1b98b66266f6649865d27337a28 (patch) | |
| tree | be07b292c7d307285b5afd78c5e816df8e2a71c5 /modules/commands | |
| parent | 91c3363c1578d24e70d0ed215d6aedc769076f08 (diff) | |
Simiplied a bit of the access system
Diffstat (limited to 'modules/commands')
48 files changed, 100 insertions, 97 deletions
diff --git a/modules/commands/bs_assign.cpp b/modules/commands/bs_assign.cpp index 803368994..5f0cdc21f 100644 --- a/modules/commands/bs_assign.cpp +++ b/modules/commands/bs_assign.cpp @@ -49,7 +49,7 @@ class CommandBSAssign : public Command return; } - if (ci->botflags.HasFlag(BS_NOBOT) || (!ci->HasPriv(u, CA_ASSIGN) && !u->HasPriv("botserv/administration"))) + if (ci->botflags.HasFlag(BS_NOBOT) || (!ci->AccessFor(u).HasPriv(CA_ASSIGN) && !u->HasPriv("botserv/administration"))) { source.Reply(ACCESS_DENIED); return; @@ -67,7 +67,7 @@ class CommandBSAssign : public Command return; } - bool override = !ci->HasPriv(u, CA_ASSIGN); + bool override = !ci->AccessFor(u).HasPriv(CA_ASSIGN); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "for " << bi->nick; bi->Assign(u, ci); @@ -111,7 +111,7 @@ class CommandBSUnassign : public Command return; } - if (!u->HasPriv("botserv/administration") && !ci->HasPriv(u, CA_ASSIGN)) + if (!u->HasPriv("botserv/administration") && !ci->AccessFor(u).HasPriv(CA_ASSIGN)) { source.Reply(ACCESS_DENIED); return; @@ -129,7 +129,7 @@ class CommandBSUnassign : public Command return; } - bool override = !ci->HasPriv(u, CA_ASSIGN); + bool override = !ci->AccessFor(u).HasPriv(CA_ASSIGN); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "for " << ci->bi->nick; ci->bi->UnAssign(u, ci); diff --git a/modules/commands/bs_badwords.cpp b/modules/commands/bs_badwords.cpp index a27dca2d4..c2ca13723 100644 --- a/modules/commands/bs_badwords.cpp +++ b/modules/commands/bs_badwords.cpp @@ -60,7 +60,7 @@ class BadwordsDelCallback : public NumberList public: BadwordsDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), Deleted(0), override(false) { - if (!ci->HasPriv(source.u, CA_BADWORDS) && source.u->HasPriv("botserv/administration")) + if (!ci->AccessFor(source.u).HasPriv(CA_BADWORDS) && source.u->HasPriv("botserv/administration")) this->override = true; } @@ -90,7 +90,7 @@ class CommandBSBadwords : public Command private: void DoList(CommandSource &source, ChannelInfo *ci, const Anope::string &word) { - bool override = !ci->HasPriv(source.u, CA_BADWORDS); + bool override = !ci->AccessFor(source.u).HasPriv(CA_BADWORDS); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source.u, this, ci) << "LIST"; if (!ci->GetBadWordCount()) @@ -167,7 +167,7 @@ class CommandBSBadwords : public Command } } - bool override = !ci->HasPriv(source.u, CA_BADWORDS); + bool override = !ci->AccessFor(source.u).HasPriv(CA_BADWORDS); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source.u, this, ci) << "ADD " << realword; ci->AddBadWord(realword, type); @@ -203,7 +203,7 @@ class CommandBSBadwords : public Command return; } - bool override = !ci->HasPriv(source.u, CA_BADWORDS); + bool override = !ci->AccessFor(source.u).HasPriv(CA_BADWORDS); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source.u, this, ci) << "DEL " << badword->word; source.Reply(_("\002%s\002 deleted from %s bad words list."), badword->word.c_str(), ci->name.c_str()); @@ -216,7 +216,7 @@ class CommandBSBadwords : public Command void DoClear(CommandSource &source, ChannelInfo *ci) { - bool override = !ci->HasPriv(source.u, CA_BADWORDS); + bool override = !ci->AccessFor(source.u).HasPriv(CA_BADWORDS); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source.u, this, ci) << "CLEAR"; ci->ClearBadWords(); @@ -254,7 +254,7 @@ class CommandBSBadwords : public Command } - if (!ci->HasPriv(u, CA_BADWORDS) && (!need_args || !u->HasPriv("botserv/administration"))) + if (!ci->AccessFor(u).HasPriv(CA_BADWORDS) && (!need_args || !u->HasPriv("botserv/administration"))) { source.Reply(ACCESS_DENIED); return; diff --git a/modules/commands/bs_control.cpp b/modules/commands/bs_control.cpp index 16a5b372a..a798c6171 100644 --- a/modules/commands/bs_control.cpp +++ b/modules/commands/bs_control.cpp @@ -35,7 +35,7 @@ class CommandBSSay : public Command return; } - if (!ci->HasPriv(u, CA_SAY)) + if (!ci->AccessFor(u).HasPriv(CA_SAY)) { source.Reply(ACCESS_DENIED); return; @@ -98,7 +98,7 @@ class CommandBSAct : public Command return; } - if (!ci->HasPriv(u, CA_SAY)) + if (!ci->AccessFor(u).HasPriv(CA_SAY)) { source.Reply(ACCESS_DENIED); return; diff --git a/modules/commands/bs_info.cpp b/modules/commands/bs_info.cpp index b48a0b296..3f1b107f2 100644 --- a/modules/commands/bs_info.cpp +++ b/modules/commands/bs_info.cpp @@ -70,7 +70,7 @@ class CommandBSInfo : public Command } else if ((ci = cs_findchan(query))) { - if (!ci->HasPriv(u, CA_FOUNDER) && !u->HasPriv("botserv/administration")) + if (!ci->AccessFor(u).HasPriv(CA_FOUNDER) && !u->HasPriv("botserv/administration")) { source.Reply(ACCESS_DENIED); return; diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp index 3f433f773..ac0420dce 100644 --- a/modules/commands/bs_kick.cpp +++ b/modules/commands/bs_kick.cpp @@ -41,13 +41,13 @@ class CommandBSKick : public Command this->OnSyntaxError(source, ""); else if (!value.equals_ci("ON") && !value.equals_ci("OFF")) this->OnSyntaxError(source, ""); - else if (!ci->HasPriv(u, CA_SET) && !u->HasPriv("botserv/administration")) + else if (!ci->AccessFor(u).HasPriv(CA_SET) && !u->HasPriv("botserv/administration")) source.Reply(ACCESS_DENIED); else if (!ci->bi) source.Reply(BOT_NOT_ASSIGNED); else { - bool override = !ci->HasPriv(u, CA_SET); + bool override = !ci->AccessFor(u).HasPriv(CA_SET); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << option << " " << value; if (option.equals_ci("BADWORDS")) @@ -768,7 +768,7 @@ class BSKick : public Module return; bool Allow = true; - if (ci->HasPriv(u, CA_NOKICK)) + if (ci->AccessFor(u).HasPriv(CA_NOKICK)) Allow = false; else if (ci->botflags.HasFlag(BS_DONTKICKOPS) && (c->HasUserStatus(u, CMODE_HALFOP) || c->HasUserStatus(u, CMODE_OP) || c->HasUserStatus(u, CMODE_PROTECT) || c->HasUserStatus(u, CMODE_OWNER))) Allow = false; @@ -993,7 +993,7 @@ class BSKick : public Module Channel *chan = (*it)->chan; ++it; - if (chan->ci != NULL && chan->ci->botflags.HasFlag(BS_KICK_AMSGS) && !chan->ci->HasPriv(u, CA_NOKICK)) + if (chan->ci != NULL && chan->ci->botflags.HasFlag(BS_KICK_AMSGS) && !chan->ci->AccessFor(u).HasPriv(CA_NOKICK)) { check_ban(chan->ci, u, TTB_AMSGS); bot_kick(chan->ci, u, _("Don't use AMSGs!")); diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp index 2591ca5a5..97bdf9525 100644 --- a/modules/commands/bs_set.cpp +++ b/modules/commands/bs_set.cpp @@ -59,11 +59,11 @@ class CommandBSSet : public Command } else if (!(ci = cs_findchan(chan))) source.Reply(CHAN_X_NOT_REGISTERED, chan.c_str()); - else if (!u->HasPriv("botserv/administration") && !ci->HasPriv(u, CA_SET)) + else if (!u->HasPriv("botserv/administration") && !ci->AccessFor(u).HasPriv(CA_SET)) source.Reply(ACCESS_DENIED); else { - bool override = !ci->HasPriv(u, CA_SET); + bool override = !ci->AccessFor(u).HasPriv(CA_SET); Log(override ? LOG_ADMIN : LOG_COMMAND, u, this, ci) << option << " " << value; if (option.equals_ci("DONTKICKOPS")) diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index fa23658c8..7c444b52c 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -121,6 +121,8 @@ class AccessChanAccess : public ChanAccess for (int i = 0; defaultLevels[i].priv != CA_SIZE; ++i) if (access->ci->levels[defaultLevels[i].priv] > highest && access->HasPriv(defaultLevels[i].priv)) highest = access->ci->levels[defaultLevels[i].priv]; + if (highest >= ACCESS_FOUNDER) + highest = ACCESS_FOUNDER - 1; return highest; } } @@ -230,7 +232,7 @@ class AccessDelCallback : public NumberList public: AccessDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &numlist) : NumberList(numlist, true), source(_source), ci(_ci), c(_c), Deleted(0), Denied(false) { - if (!ci->HasPriv(source.u, CA_ACCESS_CHANGE) && source.u->HasPriv("chanserv/access/modify")) + if (!ci->AccessFor(source.u).HasPriv(CA_ACCESS_CHANGE) && source.u->HasPriv("chanserv/access/modify")) this->override = true; } @@ -305,7 +307,7 @@ class CommandCSAccess : public Command AccessGroup u_access = ci->AccessFor(u); ChanAccess *highest = u_access.Highest(); int u_level = (highest ? AccessChanAccess::DetermineLevel(highest) : 0); - if (!ci->HasPriv(u, CA_FOUNDER) && level >= u_level && !u->HasPriv("chanserv/access/modify")) + if (level >= u_level && !u_access.Founder) { source.Reply(ACCESS_DENIED); return; @@ -316,7 +318,7 @@ class CommandCSAccess : public Command return; } - bool override = !ci->HasPriv(u, CA_ACCESS_CHANGE) || level >= u_level; + bool override = !ci->AccessFor(u).HasPriv(CA_ACCESS_CHANGE) || level >= u_level; for (unsigned i = ci->GetAccessCount(); i > 0; --i) { @@ -393,7 +395,7 @@ class CommandCSAccess : public Command else { source.Reply(_("\002%s\002 deleted from %s access list."), access->mask.c_str(), ci->name.c_str()); - bool override = !ci->HasPriv(u, CA_ACCESS_CHANGE) && !access->mask.equals_ci(u->Account()->display); + bool override = !ci->AccessFor(u).HasPriv(CA_ACCESS_CHANGE) && !access->mask.equals_ci(u->Account()->display); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "DEL " << access->mask; FOREACH_MOD(I_OnAccessDel, OnAccessDel(ci, u, access)); @@ -542,9 +544,9 @@ class CommandCSAccess : public Command bool has_access = false; if (u->HasPriv("chanserv/access/modify")) has_access = true; - else if (is_list && ci->HasPriv(u, CA_ACCESS_LIST)) + else if (is_list && ci->AccessFor(u).HasPriv(CA_ACCESS_LIST)) has_access = true; - else if (ci->HasPriv(u, CA_ACCESS_CHANGE)) + else if (ci->AccessFor(u).HasPriv(CA_ACCESS_CHANGE)) has_access = true; else if (is_del) { @@ -683,7 +685,7 @@ class CommandCSLevels : public Command ci->levels[l.priv] = level; FOREACH_MOD(I_OnLevelChange, OnLevelChange(u, ci, i, level)); - bool override = !ci->HasPriv(u, CA_FOUNDER); + bool override = !ci->AccessFor(u).HasPriv(CA_FOUNDER); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "SET " << l.name << " to " << level; if (level == ACCESS_FOUNDER) @@ -717,7 +719,7 @@ class CommandCSLevels : public Command ci->levels[l.priv] = ACCESS_INVALID; FOREACH_MOD(I_OnLevelChange, OnLevelChange(u, ci, i, l.priv)); - bool override = !ci->HasPriv(u, CA_FOUNDER); + bool override = !ci->AccessFor(u).HasPriv(CA_FOUNDER); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "DISABLE " << l.name; source.Reply(_("\002%s\002 disabled on channel %s."), l.name.c_str(), ci->name.c_str()); @@ -767,7 +769,7 @@ class CommandCSLevels : public Command reset_levels(ci); FOREACH_MOD(I_OnLevelChange, OnLevelChange(u, ci, -1, 0)); - bool override = !ci->HasPriv(u, CA_FOUNDER); + bool override = !ci->AccessFor(u).HasPriv(CA_FOUNDER); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "RESET"; source.Reply(_("Access levels for \002%s\002 reset to defaults."), ci->name.c_str()); @@ -804,7 +806,7 @@ class CommandCSLevels : public Command */ if (cmd.equals_ci("SET") ? s.empty() : (cmd.substr(0, 3).equals_ci("DIS") ? (what.empty() || !s.empty()) : !what.empty())) this->OnSyntaxError(source, cmd); - else if (!ci->HasPriv(u, CA_FOUNDER) && !u->HasPriv("chanserv/access/modify")) + else if (!ci->AccessFor(u).HasPriv(CA_FOUNDER) && !u->HasPriv("chanserv/access/modify")) source.Reply(ACCESS_DENIED); else if (cmd.equals_ci("SET")) this->DoSet(source, ci, params); diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index 437bf5572..11b4da62c 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -134,7 +134,7 @@ class AkickDelCallback : public NumberList ~AkickDelCallback() { User *u = source.u; - bool override = !ci->HasPriv(u, CA_AKICK); + bool override = !ci->AccessFor(u).HasPriv(CA_AKICK); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, c, ci) << "DEL on " << Deleted << " users"; if (!Deleted) @@ -213,7 +213,7 @@ class CommandCSAKick : public Command AccessGroup nc_access = ci->AccessFor(nc), u_access = ci->AccessFor(u); Entry entry_mask(CMODE_BEGIN, mask); - if ((ci->HasPriv(u2, CA_FOUNDER) || nc_access >= u_access) && entry_mask.Matches(u2)) + if ((ci->AccessFor(u2).HasPriv(CA_FOUNDER) || nc_access >= u_access) && entry_mask.Matches(u2)) { source.Reply(ACCESS_DENIED); return; @@ -260,7 +260,7 @@ class CommandCSAKick : public Command else akick = ci->AddAkick(u->nick, mask, reason); - bool override = !ci->HasPriv(u, CA_AKICK); + bool override = !ci->AccessFor(u).HasPriv(CA_AKICK); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "ADD " << mask << ": " << reason; FOREACH_MOD(I_OnAkickAdd, OnAkickAdd(u, ci, akick)); @@ -309,7 +309,7 @@ class CommandCSAKick : public Command return; } - bool override = !ci->HasPriv(u, CA_AKICK); + bool override = !ci->AccessFor(u).HasPriv(CA_AKICK); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "DEL " << mask; ci->EraseAkick(i); @@ -324,7 +324,7 @@ class CommandCSAKick : public Command const Anope::string &mask = params.size() > 2 ? params[2] : ""; - bool override = !ci->HasPriv(u, CA_AKICK); + bool override = !ci->AccessFor(u).HasPriv(CA_AKICK); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "LIST"; if (!ci->GetAkickCount()) @@ -374,7 +374,7 @@ class CommandCSAKick : public Command const Anope::string &mask = params.size() > 2 ? params[2] : ""; - bool override = !ci->HasPriv(u, CA_AKICK); + bool override = !ci->AccessFor(u).HasPriv(CA_AKICK); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "VIEW"; if (!ci->GetAkickCount()) @@ -438,7 +438,7 @@ class CommandCSAKick : public Command ++count; } - bool override = !ci->HasPriv(u, CA_AKICK); + bool override = !ci->AccessFor(u).HasPriv(CA_AKICK); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "ENFORCE, affects " << count << " users"; source.Reply(_("AKICK ENFORCE for \002%s\002 complete; \002%d\002 users were affected."), ci->name.c_str(), count); @@ -447,7 +447,7 @@ class CommandCSAKick : public Command void DoClear(CommandSource &source, ChannelInfo *ci) { User *u = source.u; - bool override = !ci->HasPriv(u, CA_AKICK); + bool override = !ci->AccessFor(u).HasPriv(CA_AKICK); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "CLEAR"; ci->ClearAkick(); @@ -483,7 +483,7 @@ class CommandCSAKick : public Command if (mask.empty() && (cmd.equals_ci("ADD") || cmd.equals_ci("DEL"))) this->OnSyntaxError(source, cmd); - else if (!ci->HasPriv(u, CA_AKICK) && !u->HasPriv("chanserv/access/modify")) + else if (!ci->AccessFor(u).HasPriv(CA_AKICK) && !u->HasPriv("chanserv/access/modify")) source.Reply(ACCESS_DENIED); else if (!cmd.equals_ci("LIST") && !cmd.equals_ci("VIEW") && !cmd.equals_ci("ENFORCE") && readonly) source.Reply(_("Sorry, channel autokick list modification is temporarily disabled.")); diff --git a/modules/commands/cs_appendtopic.cpp b/modules/commands/cs_appendtopic.cpp index 6d66d1724..63fb0a785 100644 --- a/modules/commands/cs_appendtopic.cpp +++ b/modules/commands/cs_appendtopic.cpp @@ -58,7 +58,7 @@ class CommandCSAppendTopic : public Command source.Reply(CHAN_X_NOT_IN_USE, params[0].c_str()); else if (!c->ci) source.Reply(CHAN_X_NOT_REGISTERED, c->name.c_str()); - else if (!c->ci->HasPriv(u, CA_TOPIC)) + else if (!c->ci->AccessFor(u).HasPriv(CA_TOPIC)) source.Reply(ACCESS_DENIED); else { @@ -77,7 +77,7 @@ class CommandCSAppendTopic : public Command if (has_topiclock) c->ci->SetFlag(CI_TOPICLOCK); - bool override = c->ci->HasPriv(u, CA_TOPIC); + bool override = c->ci->AccessFor(u).HasPriv(CA_TOPIC); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, c->ci) << "changed topic to " << topic; } return; diff --git a/modules/commands/cs_ban.cpp b/modules/commands/cs_ban.cpp index 759649662..de506e3fe 100644 --- a/modules/commands/cs_ban.cpp +++ b/modules/commands/cs_ban.cpp @@ -46,7 +46,7 @@ class CommandCSBan : public Command source.Reply(CHAN_X_NOT_IN_USE, chan.c_str()); else if (!u2) source.Reply(NICK_X_NOT_IN_USE, target.c_str()); - else if (!ci->HasPriv(u, CA_BAN)) + else if (!ci->AccessFor(u).HasPriv(CA_BAN)) source.Reply(ACCESS_DENIED); else if (!is_same && ci->HasFlag(CI_PEACE) && u2_access >= u_access) source.Reply(ACCESS_DENIED); @@ -72,7 +72,7 @@ class CommandCSBan : public Command if (!c->FindUser(u2)) return; - if (ci->HasFlag(CI_SIGNKICK) || (ci->HasFlag(CI_SIGNKICK_LEVEL) && !ci->HasPriv(u, CA_SIGNKICK))) + if (ci->HasFlag(CI_SIGNKICK) || (ci->HasFlag(CI_SIGNKICK_LEVEL) && !ci->AccessFor(u).HasPriv(CA_SIGNKICK))) c->Kick(ci->WhoSends(), u2, "%s (%s)", reason.c_str(), u->nick.c_str()); else c->Kick(ci->WhoSends(), u2, "%s", reason.c_str()); diff --git a/modules/commands/cs_clearusers.cpp b/modules/commands/cs_clearusers.cpp index 18dc75479..91dc68cc2 100644 --- a/modules/commands/cs_clearusers.cpp +++ b/modules/commands/cs_clearusers.cpp @@ -34,7 +34,7 @@ class CommandCSClearUsers : public Command source.Reply(CHAN_X_NOT_IN_USE, chan.c_str()); else if (!c->ci) source.Reply(CHAN_X_NOT_REGISTERED, c->name.c_str()); - else if (!c->ci->HasPriv(u, CA_FOUNDER)) + else if (!c->ci->AccessFor(u).HasPriv(CA_FOUNDER)) { source.Reply(ACCESS_DENIED); return; diff --git a/modules/commands/cs_clone.cpp b/modules/commands/cs_clone.cpp index f9cbe12d6..7e4579af0 100644 --- a/modules/commands/cs_clone.cpp +++ b/modules/commands/cs_clone.cpp @@ -36,7 +36,7 @@ public: return; } - if (!ci->HasPriv(u, CA_SET)) + if (!ci->AccessFor(u).HasPriv(CA_SET)) { source.Reply(ACCESS_DENIED); return; diff --git a/modules/commands/cs_drop.cpp b/modules/commands/cs_drop.cpp index eb01875db..aa41046a9 100644 --- a/modules/commands/cs_drop.cpp +++ b/modules/commands/cs_drop.cpp @@ -49,7 +49,7 @@ class CommandCSDrop : public Command return; } - if ((ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->HasPriv(u, CA_FOUNDER)) && !u->HasCommand("chanserv/chanserv/drop")) + if ((ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->AccessFor(u).HasPriv(CA_FOUNDER)) && !u->HasCommand("chanserv/chanserv/drop")) { source.Reply(ACCESS_DENIED); return; @@ -58,7 +58,7 @@ class CommandCSDrop : public Command if (ci->c && ModeManager::FindChannelModeByName(CMODE_REGISTERED)) ci->c->RemoveMode(NULL, CMODE_REGISTERED, "", false); - bool override = (ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->HasPriv(u, CA_FOUNDER)); + bool override = (ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->AccessFor(u).HasPriv(CA_FOUNDER)); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "founder: " << (ci->GetFounder() ? ci->GetFounder()->display : "none"); delete ci; diff --git a/modules/commands/cs_enforce.cpp b/modules/commands/cs_enforce.cpp index 395926a46..267a0a850 100644 --- a/modules/commands/cs_enforce.cpp +++ b/modules/commands/cs_enforce.cpp @@ -129,7 +129,7 @@ class CommandCSEnforce : public Command source.Reply(CHAN_X_NOT_IN_USE, params[0].c_str()); else if (!c->ci) source.Reply(CHAN_X_NOT_REGISTERED, c->name.c_str()); - else if (!c->ci->HasPriv(u, CA_AKICK)) + else if (!c->ci->AccessFor(u).HasPriv(CA_AKICK)) source.Reply(ACCESS_DENIED); else { diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp index 48f1a22f1..07a441141 100644 --- a/modules/commands/cs_flags.cpp +++ b/modules/commands/cs_flags.cpp @@ -361,9 +361,9 @@ class CommandCSFlags : public Command bool has_access = false; if (u->HasPriv("chanserv/access/modify")) has_access = true; - else if (is_list && ci->HasPriv(u, CA_ACCESS_LIST)) + else if (is_list && ci->AccessFor(u).HasPriv(CA_ACCESS_LIST)) has_access = true; - else if (ci->HasPriv(u, CA_ACCESS_CHANGE)) + else if (ci->AccessFor(u).HasPriv(CA_ACCESS_CHANGE)) has_access = true; if (!has_access) diff --git a/modules/commands/cs_getkey.cpp b/modules/commands/cs_getkey.cpp index 4a6d62442..48d5cd2eb 100644 --- a/modules/commands/cs_getkey.cpp +++ b/modules/commands/cs_getkey.cpp @@ -35,7 +35,7 @@ class CommandCSGetKey : public Command } - if (!ci->HasPriv(u, CA_GETKEY) && !u->HasCommand("chanserv/chanserv/getkey")) + if (!ci->AccessFor(u).HasPriv(CA_GETKEY) && !u->HasCommand("chanserv/chanserv/getkey")) { source.Reply(ACCESS_DENIED); return; @@ -48,7 +48,7 @@ class CommandCSGetKey : public Command return; } - bool override = !ci->HasPriv(u, CA_GETKEY); + bool override = !ci->AccessFor(u).HasPriv(CA_GETKEY); Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci); source.Reply(_("Key for channel \002%s\002 is \002%s\002."), chan.c_str(), key.c_str()); diff --git a/modules/commands/cs_info.cpp b/modules/commands/cs_info.cpp index ef026563e..9f4a29852 100644 --- a/modules/commands/cs_info.cpp +++ b/modules/commands/cs_info.cpp @@ -50,7 +50,7 @@ class CommandCSInfo : public Command bool show_all = false; /* Should we show all fields? Only for sadmins and identified users */ - if (has_auspex || ci->HasPriv(u, CA_INFO)) + if (has_auspex || ci->AccessFor(u).HasPriv(CA_INFO)) show_all = true; source.Reply(CHAN_INFO_HEADER, chan.c_str()); diff --git a/modules/commands/cs_invite.cpp b/modules/commands/cs_invite.cpp index 27b4b03a3..9773ba332 100644 --- a/modules/commands/cs_invite.cpp +++ b/ |
