mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-23 16:26:15 -05:00
Add permissions for announce/declare
This commit is contained in:
parent
2b57714d04
commit
17dcc94c0d
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user