mirror of
https://github.com/reality/dbot.git
synced 2024-11-23 20:39:25 +01:00
Fix access control [Close #436]
This commit is contained in:
parent
571d132d70
commit
80b586ba60
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user