From 80b586ba605b93eb1f361fc823730991e32721eb Mon Sep 17 00:00:00 2001 From: reality Date: Mon, 6 May 2013 21:49:45 +0000 Subject: [PATCH] Fix access control [Close #436] --- modules/command/api.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/command/api.js b/modules/command/api.js index 4abaa9b..5fb8aa4 100644 --- a/modules/command/api.js +++ b/modules/command/api.js @@ -21,7 +21,10 @@ var api = function(dbot) { var accessNeeded = dbot.commands[command].access; if(accessNeeded == 'admin' || accessNeeded == 'moderator') { - if(!_.include(dbot.config[accessNeeded + 's'], user)) { // lol + var allowedNicks = dbot.config.admins; + if(accessNeeded == 'moderator') allowedNicks = _.union(allowedNicks, dbot.config.moderators); + + if(!_.include(allowedNicks, user)) { callback(false); } else { if(_.has(dbot.modules, 'nickserv') && this.config.useNickserv == true) {