summaryrefslogtreecommitdiff
path: root/modules/commands/cs_akick.cpp
diff options
context:
space:
mode:
authorThomas Fargeix <t.fargeix@gmail.com>2014-10-11 22:56:31 +0200
committerAdam <Adam@anope.org>2014-10-12 10:52:48 -0400
commit96583892c6a0bc48029348ddcf86b1afc5a9915d (patch)
treea232b6a1dcbc2a5b0ad839b9a14b9a85e6645549 /modules/commands/cs_akick.cpp
parent0991d4e1998c5a87c8deb3f9460685eed0212160 (diff)
Add a chanserv/access/list privilege
Replace the existing chanserv/access/list command access, only used in cs_xop, by a privilege with the same name. It which allows read-only access to cs_access, cs_flags, cs_xop and cs_akick, while the already-existing chanserv/access/modify privilege allows to modify them.
Diffstat (limited to 'modules/commands/cs_akick.cpp')
-rw-r--r--modules/commands/cs_akick.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp
index 1fac25335..03db4c623 100644
--- a/modules/commands/cs_akick.cpp
+++ b/modules/commands/cs_akick.cpp
@@ -441,9 +441,17 @@ class CommandCSAKick : public Command
return;
}
+ bool is_list = cmd.equals_ci("LIST") || cmd.equals_ci("VIEW");
+
+ bool has_access = false;
+ if (source.AccessFor(ci).HasPriv("AKICK") || source.HasPriv("chanserv/access/modify"))
+ has_access = true;
+ else if (is_list && source.HasPriv("chanserv/access/list"))
+ has_access = true;
+
if (mask.empty() && (cmd.equals_ci("ADD") || cmd.equals_ci("DEL")))
this->OnSyntaxError(source, cmd);
- else if (!source.AccessFor(ci).HasPriv("AKICK") && !source.HasPriv("chanserv/access/modify"))
+ else if (!has_access)
source.Reply(ACCESS_DENIED);
else if (!cmd.equals_ci("LIST") && !cmd.equals_ci("VIEW") && !cmd.equals_ci("ENFORCE") && Anope::ReadOnly)
source.Reply(_("Sorry, channel autokick list modification is temporarily disabled."));