summaryrefslogtreecommitdiff
path: root/modules/commands/os_oper.cpp
diff options
context:
space:
mode:
authorThomas Fargeix <t.fargeix@gmail.com>2014-10-12 00:12:09 +0200
committerAdam <Adam@anope.org>2014-10-12 10:54:11 -0400
commit1c1297695894fd543554b1a063b1dee990594885 (patch)
treed685ed39164b7b530a8ffc1cb5868e11ef45873e /modules/commands/os_oper.cpp
parent96583892c6a0bc48029348ddcf86b1afc5a9915d (diff)
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.
Diffstat (limited to 'modules/commands/os_oper.cpp')
-rw-r--r--modules/commands/os_oper.cpp12
1 files changed, 12 insertions, 0 deletions
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());