summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/commands.c7
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));