diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-79591-ExtbaseCommandControllersAdminRoleMethods.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-79591-ExtbaseCommandControllersAdminRoleMethods.rst new file mode 100644 index 0000000000000000000000000000000000000000..5631204d15ad0dc368be77c86bdcb999009103b8 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-79591-ExtbaseCommandControllersAdminRoleMethods.rst @@ -0,0 +1,35 @@ +.. include:: ../../Includes.txt + +==================================================================== +Deprecation: #79591 - Extbase command controllers admin role methods +==================================================================== + +See :issue:`79591` + +Description +=========== + +The methods php:``CommandController->ensureAdminRoleIfRequested()`` and +php:``CommandController->restoreUserRole()`` have been marked as deprecated. + +All CLI scripts are now executed with administrator access rights, so this functionality is obsolete. + + +Impact +====== + +Calling any of the methods above will trigger a deprecation log warning. + + +Affected Installations +====================== + +Any installation with custom CLI Extbase Command Controllers using the methods above. + + +Migration +========= + +Remove the affected lines where the methods are called, as they are not necessary anymore. + +.. index:: CLI \ No newline at end of file diff --git a/typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php b/typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php index 24c37230f650f641b9d4586fd87cc14f18473c33..741debf70f3ded8425449268473b31f4569de702 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php +++ b/typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php @@ -15,6 +15,7 @@ namespace TYPO3\CMS\Extbase\Mvc\Controller; */ use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; +use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Cli\CommandArgumentDefinition; use TYPO3\CMS\Extbase\Mvc\Cli\ConsoleOutput; use TYPO3\CMS\Extbase\Mvc\Cli\Request; @@ -263,9 +264,11 @@ class CommandController implements CommandControllerInterface * and returns the original state or NULL * * @return NULL|int + * @deprecated since TYPO3 v8, will be removed in TYPO3 v9, because admin role is always used in CLI mode */ protected function ensureAdminRoleIfRequested() { + GeneralUtility::logDeprecatedFunction(); $userAuthentication = $this->getBackendUserAuthentication(); if (!$this->requestAdminPermissions || $userAuthentication === null || !isset($userAuthentication->user['admin'])) { @@ -281,9 +284,11 @@ class CommandController implements CommandControllerInterface * Restores the original user role * * @param NULL|int $originalRole + * @deprecated since TYPO3 v8, will be removed in TYPO3 v9, because admin role is always used in CLI mode */ protected function restoreUserRole($originalRole) { + GeneralUtility::logDeprecatedFunction(); $userAuthentication = $this->getBackendUserAuthentication(); if ($originalRole !== null && $userAuthentication !== null) {