[BUGFIX] Add user authentication to activate extension command
[Packages/TYPO3.CMS.git] / typo3 / sysext / extensionmanager / Classes / Command / ActivateExtensionCommand.php
index 94afb6b..060e8a8 100644 (file)
@@ -20,6 +20,7 @@ use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
 use Symfony\Component\Console\Style\SymfonyStyle;
+use TYPO3\CMS\Core\Core\Bootstrap;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;
@@ -56,6 +57,9 @@ class ActivateExtensionCommand extends Command
         $io = new SymfonyStyle($input, $output);
         $extensionKey = $input->getArgument('extensionkey');
 
+        // Ensure the _cli_ user is authenticated because the extension might import data
+        Bootstrap::initializeBackendAuthentication();
+
         $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
         // Emits packages may have changed signal
         $signalSlotDispatcher = $objectManager->get(Dispatcher::class);