Add permissions for announce/declare

This commit is contained in:
Guangcong Luo 2012-08-16 11:57:08 -07:00
parent 2b57714d04
commit 17dcc94c0d

View File

@ -675,6 +675,10 @@ function parseCommandLocal(user, cmd, target, room, socket, message) {
emit(socket, 'console', 'That moderated chat setting is unrecognized.');
return false;
}
if (target !== '+' && !user.can('modchatall')) {
emit(socket, 'console', '/modchat - Access denied for setting higher than +.');
return false;
}
config.modchat = target;
break;
}
@ -692,8 +696,7 @@ function parseCommandLocal(user, cmd, target, room, socket, message) {
case 'declare':
if (!target) return parseCommand(user, '?', cmd, room, socket);
// announce is used because leaders and up can already announce and i didn't want to try and mess with permissions
if (!user.can('announce')) {
if (!user.can('declare')) {
emit(socket, 'console', '/declare - Access denied.');
return false;
}
@ -706,8 +709,7 @@ function parseCommandLocal(user, cmd, target, room, socket, message) {
case 'announce':
case 'wall':
if (!target) return parseCommand(user, '?', cmd, room, socket);
// mute is used because drivers and up can already mute and i didn't want to try and mess with permissions
if (!user.can('mute')) {
if (!user.can('announce')) {
emit(socket, 'console', '/announce - Access denied.');
return false;
}