javascript/features/playground/playground_commands.js
// required level, as well as options to grant and revoke exceptions for the command.
required level, as well as options to grant and revoke exceptions for the command.
required level as well as options to grant and revoke exceptions for the command .
async displayCommandMenu(commandName, player) {
        const menu = new Menu('/' + commandName + ' access settings');
        const exceptions = this.access_.getExceptions(commandName);
        exceptions.sort((lhs, rhs) =>
            lhs.name.localeCompare(rhs.name));
        menu.addItem('Change required level',
                     PlaygroundCommands.prototype.displayCommandLevelMenu.bind(this, commandName));
        menu.addItem('Grant exception',
                     PlaygroundCommands.prototype.grantCommandException.bind(this, commandName));
        if (exceptions.length) {
            menu.addItem('------------------------',
                         PlaygroundCommands.prototype.displayCommandMenu.bind(this, commandName));
            exceptions.forEach(subject => {
                menu.addItem(
                    'Revoke for ' + subject.name + ' (Id: ' + subject.id + ')',
                    PlaygroundCommands.prototype.revokeCommandException.bind(this, commandName,
                                                                             subject));
            });
        }
        await menu.displayForPlayer(player);
    }
async displayCommandMenu ( commandName , player ) { const menu = new Menu ( '/' + commandName + ' access settings' ) ; const exceptions = this . access_ . getExceptions ( commandName ) ; exceptions . sort ( ( lhs , rhs ) => lhs . name . localeCompare ( rhs . name ) ) ; menu . addItem ( 'Change required level' , PlaygroundCommands . prototype . displayCommandLevelMenu . bind ( this , commandName ) ) ; menu . addItem ( 'Grant exception' , PlaygroundCommands . prototype . grantCommandException . bind ( this , commandName ) ) ; if ( exceptions . length ) { menu . addItem ( '------------------------' , PlaygroundCommands . prototype . displayCommandMenu . bind ( this , commandName ) ) ; exceptions . forEach ( subject => { menu . addItem ( 'Revoke for ' + subject . name + ' (Id: ' + subject . id + ')' , PlaygroundCommands . prototype . revokeCommandException . bind ( this , commandName , subject ) ) ; } ) ; } await menu . displayForPlayer ( player ) ; }
required level, as well as options to grant and revoke exceptions for the command.
required level as well as options to grant and revoke exceptions for the command .