public function deactivateGlobalButton(ActionEvent $event)
    {
        $allowedAction = ['selectModelAll', 'selectPropertyAll', 'editAll', 'overrideAll'];
        if (!$this->scopeDeterminator->currentScopeIsBackend()
            || !\in_array($event->getAction()->getName(), $allowedAction)) {
            return;
        }

        $dataDefinition = $event->getEnvironment()->getDataDefinition();
        $backendView    = $dataDefinition->getDefinition(Contao2BackendViewDefinitionInterface::NAME);
        $globalCommands = $backendView->getGlobalCommands();

        $allowedButton = ['close_all_button'];
        if ('selectModelAll' !== $event->getAction()->getName()) {
            $allowedButton[] = 'back_button';
        }

        foreach ($globalCommands->getCommands() as $command) {
            if (\in_array($command->getName(), $allowedButton)) {
                continue;
            }

            $command->setDisabled(true);
        }
    }