From dc102049b0e91c5aa730f067c26e33f3e138386d Mon Sep 17 00:00:00 2001 From: cyberbotx Date: Tue, 5 May 2009 22:26:41 +0000 Subject: Adds check for opertype permissions to mod_run_cmd() in commands.c, and adds optional parameter to Command class constructor that takes the opertype permissions for the command. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2292 5417fbe8-f217-4b02-8779-1006273d7864 --- src/commands.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/commands.c') diff --git a/src/commands.c b/src/commands.c index 5f9c682ab..a95a9f7b2 100644 --- a/src/commands.c +++ b/src/commands.c @@ -88,6 +88,17 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char * // Check whether or not access string is empty } + if (!c->permission.empty()) + { + if (!u->nc->HasPriv(c->permission) && !u->nc->HasCommand(c->permission)) + { + notice_lang(service, u, ACCESS_DENIED); + alog("Access denied for user %s with service %s and command %s", u->nick, service, cmd); + return; + } + + } + std::vector params; std::string curparam; char *s = NULL; -- cgit