From 1c1297695894fd543554b1a063b1dee990594885 Mon Sep 17 00:00:00 2001 From: Thomas Fargeix Date: Sun, 12 Oct 2014 00:12:09 +0200 Subject: Add an operserv/oper/modify privilege. The operserv/oper command privilege allows to add operators with fewer or the same privileges as ourself. This new privilege allows to have operators who can use operserv/oper to see the list of operators and their privileges, but cannot add new operators. --- data/example.conf | 1 + docs/Changes.conf | 1 + modules/commands/os_oper.cpp | 12 ++++++++++++ 3 files changed, 14 insertions(+) diff --git a/data/example.conf b/data/example.conf index f8db60b23..223f770fb 100644 --- a/data/example.conf +++ b/data/example.conf @@ -763,6 +763,7 @@ log * nickserv/confirm - Can confirm other users nicknames * nickserv/drop - Can drop other users nicks * operserv/config - Can modify services's configuration + * operserv/oper/modify - Can add and remove operators with at most the same privileges * protected - Can not be kicked from channels by Services * * Available commands: diff --git a/docs/Changes.conf b/docs/Changes.conf index d63cf9c15..1b66f56a9 100644 --- a/docs/Changes.conf +++ b/docs/Changes.conf @@ -1,5 +1,6 @@ Anope Version 2.0.2 ------------------- +Add an operserv/oper/modify privilege, required to use oper add and oper del Add a chanserv/access/list privilege, which allow readonly access to ChanServ access and akick lists Anope Version 2.0.1 diff --git a/modules/commands/os_oper.cpp b/modules/commands/os_oper.cpp index 370a974b4..71cdf026c 100644 --- a/modules/commands/os_oper.cpp +++ b/modules/commands/os_oper.cpp @@ -82,6 +82,12 @@ class CommandOSOper : public Command const Anope::string &oper = params[1]; const Anope::string &otype = params[2]; + if (!source.HasPriv("operserv/oper/modify")) + { + source.Reply(ACCESS_DENIED); + return; + } + const NickAlias *na = NickAlias::Find(oper); if (na == NULL) source.Reply(NICK_X_NOT_REGISTERED, oper.c_str()); @@ -115,6 +121,12 @@ class CommandOSOper : public Command { const Anope::string &oper = params[1]; + if (!source.HasPriv("operserv/oper/modify")) + { + source.Reply(ACCESS_DENIED); + return; + } + const NickAlias *na = NickAlias::Find(oper); if (na == NULL) source.Reply(NICK_X_NOT_REGISTERED, oper.c_str()); -- cgit