diff options
author | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-04-16 20:29:21 +0000 |
---|---|---|
committer | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-04-16 20:29:21 +0000 |
commit | 3e9bd7583c555a23cb4d5b8f91966d0048953e58 (patch) | |
tree | 70f74272d5cd324a0c0c360aa63e41d2764505b2 /src | |
parent | fc4f89e0798ede80ce5b26b2b28423390e70db08 (diff) |
Check Command::permission in command handler.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2283 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/commands.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/commands.c b/src/commands.c index f6c2594af..5f9c682ab 100644 --- a/src/commands.c +++ b/src/commands.c @@ -146,6 +146,13 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char * } } + // If the command requires a permission, and they aren't registered or don't have the required perm, DENIED + if (!c->permission.empty() && (!u->nc || !u->nc->HasCommand(c->permission))) + { + notice_lang(service, u, ACCESS_DENIED); + return; + } + retVal = c->Execute(u, params); FOREACH_MOD(I_OnPostCommand, OnPostCommand(u, c->service, c->name, params)); |