Fix access control [Close #436]

This commit is contained in:
reality 2013-05-06 21:49:45 +00:00
parent 571d132d70
commit 80b586ba60

View File

@ -21,7 +21,10 @@ var api = function(dbot) {
var accessNeeded = dbot.commands[command].access; var accessNeeded = dbot.commands[command].access;
if(accessNeeded == 'admin' || accessNeeded == 'moderator') { 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); callback(false);
} else { } else {
if(_.has(dbot.modules, 'nickserv') && this.config.useNickserv == true) { if(_.has(dbot.modules, 'nickserv') && this.config.useNickserv == true) {