mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-06 22:43:29 -05:00
Fix tournaments permissions
Previously, ROs/leaders couldn't enable/start tournaments
This commit is contained in:
parent
4590deff58
commit
d3b00a3a2b
|
|
@ -820,9 +820,7 @@ CommandParser.commands.tournament = function (paramString, room, user) {
|
|||
"More detailed help can be found <a href=\"https://gist.github.com/kotarou3/7872574\">here</a>"
|
||||
);
|
||||
} else if (cmd === 'on' || cmd === 'enable') {
|
||||
if (!user.can('tournamentsmanagement')) {
|
||||
return this.sendReply(cmd + " - Access denied.");
|
||||
}
|
||||
if (!this.can('tournamentsmanagement', null, room)) return;
|
||||
if (room.toursEnabled) {
|
||||
return this.sendReply("Tournaments are already enabled.");
|
||||
}
|
||||
|
|
@ -833,9 +831,7 @@ CommandParser.commands.tournament = function (paramString, room, user) {
|
|||
}
|
||||
return this.sendReply("Tournaments enabled.");
|
||||
} else if (cmd === 'off' || cmd === 'disable') {
|
||||
if (!user.can('tournamentsmanagement')) {
|
||||
return this.sendReply(cmd + " - Access denied.");
|
||||
}
|
||||
if (!this.can('tournamentsmanagement', null, room)) return;
|
||||
if (!room.toursEnabled) {
|
||||
return this.sendReply("Tournaments are already disabled.");
|
||||
}
|
||||
|
|
@ -847,11 +843,9 @@ CommandParser.commands.tournament = function (paramString, room, user) {
|
|||
return this.sendReply("Tournaments disabled.");
|
||||
} else if (cmd === 'create' || cmd === 'new') {
|
||||
if (room.toursEnabled) {
|
||||
if (!user.can('tournaments', null, room)) {
|
||||
return this.sendReply(cmd + " - Access denied.");
|
||||
}
|
||||
if (!this.can('tournaments', null, room)) return;
|
||||
} else {
|
||||
if (!user.can('tournamentsmanagement'), null, room) {
|
||||
if (!user.can('tournamentsmanagement', null, room)) {
|
||||
return this.sendReply("Tournaments are disabled in this room ("+room.id+").");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user