diff options
author | Adam <adam@sigterm.info> | 2015-07-01 19:50:26 -0400 |
---|---|---|
committer | Adam <adam@sigterm.info> | 2015-07-01 19:50:26 -0400 |
commit | 5be9de5d123f578ec3eec9e6620998b5765fa580 (patch) | |
tree | 0bc802c8e4c22fbdb27956dc0c9f7972f4ae3e2c /modules/commands/cs_access.cpp | |
parent | 02ed9a9725c40b57df965c4a13579bafebef2af3 (diff) | |
parent | 57b614ae59603b6628012ef9ba86912dbb240f8e (diff) |
Merge pull request #123 from Alef-Burzmali/2.0+cs-levels
Allow opers with chanserv/access/list to view the levels list
Diffstat (limited to 'modules/commands/cs_access.cpp')
-rw-r--r-- | modules/commands/cs_access.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index 7fef5bfc5..2fc245690 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -758,12 +758,20 @@ class CommandCSLevels : public Command return; } + bool has_access = false; + if (source.HasPriv("chanserv/access/modify")) + has_access = true; + else if (cmd.equals_ci("LIST") && source.HasPriv("chanserv/access/list")) + has_access = true; + else if (source.AccessFor(ci).HasPriv("FOUNDER")) + has_access = true; + /* If SET, we want two extra parameters; if DIS[ABLE] or FOUNDER, we want only * one; else, we want none. */ 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 (!source.AccessFor(ci).HasPriv("FOUNDER") && !source.HasPriv("chanserv/access/modify")) + else if (!has_access) source.Reply(ACCESS_DENIED); else if (Anope::ReadOnly && !cmd.equals_ci("LIST")) source.Reply(READ_ONLY_MODE); |