Used access parameter on all elevated access commadns I can think of [#124]

This commit is contained in:
reality 2013-01-12 09:49:41 +00:00
parent f8d4896eb6
commit 6b903407ed
3 changed files with 62 additions and 64 deletions

View File

@ -22,17 +22,17 @@ var js = function(dbot) {
// Run JS code un-sandboxed, with access to DBot memory (admin-only).
'~ajs': function(event) {
if(dbot.config.admins.include(event.user) ) {
var ret = eval(event.input[1]);
if(ret !== undefined) {
event.reply(ret);
}
}
}
};
commands['~js'].regex = [/^~js (.*)/, 2];
commands['~ajs'].regex = [/^~ajs (.*)/, 2];
commands['~ajs'].access = 'admin';
return {
'name': 'js',
'ignorable': true,

View File

@ -93,16 +93,13 @@ var quotes = function(dbot) {
},
'~rmconfirm': function(event) {
if(dbot.config.admins.include(event.user)) {
var rmCacheCount = rmCache.length;
rmCache.length = 0;
event.reply(dbot.t('quote_cache_cleared',
{ 'count': rmCacheCount }));
}
},
'~rmdeny': function(event) {
if(dbot.config.admins.include(event.user)) {
var rmCacheCount = rmCache.length;
for(var i=0;i<rmCacheCount;i++) {
if(!quotes.hasOwnProperty(rmCache[i].key)) {
@ -114,7 +111,6 @@ var quotes = function(dbot) {
event.reply(dbot.t('quote_cache_reinstated',
{ 'count': rmCacheCount }));
}
},
@ -271,6 +267,9 @@ var quotes = function(dbot) {
commands['~rmlast'].regex = [/^~rmlast ([\d\w\s-]*)/, 2];
commands['~qadd'].regex = [/^~qadd ([\d\w\s-]+?)[ ]?=[ ]?(.+)$/, 3];
commands['~rmconfirm'].access = 'moderator';
commands['~rmdeny'].access = 'moderator';
var pages = {
// Lists quotes in a category
'/quotes/:key': function(req, res) {

View File

@ -95,7 +95,6 @@ var users = function(dbot) {
},
'~setaliasparent': function(event) {
if(dbot.config.admins.include(event.user)) {
var knownUsers = getServerUsers(event.server);
var newParent = event.params[1];
@ -124,11 +123,9 @@ var users = function(dbot) {
} else {
event.reply(dbot.t('unknown_alias', { 'alias': newParent}));
}
}
},
'~mergeusers': function(event) {
if(dbot.config.admins.include(event.user)) {
var knownUsers = getServerUsers(event.server);
var primaryUser = event.params[1];
var secondaryUser = event.params[2];
@ -149,9 +146,11 @@ var users = function(dbot) {
event.reply(dbot.t('unprimary_error'));
}
}
}
};
commands['~setaliasparent'].access = 'moderator';
commands['~mergeusers'].access = 'moderator';
return {
'name': 'users',
'ignorable': false,