diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-85554-PageRepository-checkWorkspaceAccess.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-85554-PageRepository-checkWorkspaceAccess.rst new file mode 100644 index 0000000000000000000000000000000000000000..983f48f56c9694a0528f98fa3c0c07b676ad9d5c --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-85554-PageRepository-checkWorkspaceAccess.rst @@ -0,0 +1,33 @@ +.. include:: ../../Includes.txt + +========================================================== +Deprecation: #85554 - PageRepository->checkWorkspaceAccess +========================================================== + +See :issue:`85554` + +Description +=========== + +The unused method :php:`TYPO3\CMS\Frontend\Page\PageRepository->checkWorkspaceAccess()` has been marked as +deprecated. + + +Impact +====== + +Calling the method directly will trigger a deprecation message. + + +Affected Installations +====================== + +TYPO3 installations with custom extensions calling this public method directly. + + +Migration +========= + +Implement the check on :php:`BE_USER->checkWorkspace($workspaceId)` directly in the callers' code. + +.. index:: Frontend, PHP-API, FullyScanned, ext:frontend \ No newline at end of file diff --git a/typo3/sysext/frontend/Classes/Page/PageRepository.php b/typo3/sysext/frontend/Classes/Page/PageRepository.php index c187a1444de66bde58722ce7c02705711675f8de..1a94990d2d24b5750bfdbbfd2c7f97e8ee1fd0d9 100644 --- a/typo3/sysext/frontend/Classes/Page/PageRepository.php +++ b/typo3/sysext/frontend/Classes/Page/PageRepository.php @@ -1654,7 +1654,7 @@ class PageRepository implements LoggerAwareInterface } // If workspace ids matches and ID of current online version is found, look up // the PID value of that: - if ($oid && ((int)$this->versioningWorkspaceId === 0 && $this->checkWorkspaceAccess($wsid) || (int)$wsid === (int)$this->versioningWorkspaceId)) { + if ($oid && (int)$wsid === (int)$this->versioningWorkspaceId) { $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table); $queryBuilder->getRestrictions() ->removeAll() @@ -1970,9 +1970,11 @@ class PageRepository implements LoggerAwareInterface * * @param int $wsid Workspace ID * @return bool true if the backend user has access to a certain workspace + * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0. Use $BE_USER->checkWorkspace() directly if necessary. */ public function checkWorkspaceAccess($wsid) { + trigger_error('PageRepository->checkWorkspaceAccess() will be removed in TYPO3 v10.0.', E_USER_DEPRECATED); if (!$this->getBackendUser() || !ExtensionManagementUtility::isLoaded('workspaces')) { return false; } @@ -2055,6 +2057,7 @@ class PageRepository implements LoggerAwareInterface * Returns the current BE user. * * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication + * @deprecated will be removed in TYPO3 v10.0 as will not be used anymore then because checkWorkspaceAccess() will be removed. */ protected function getBackendUser() { diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php index c612d84454d5258bb5fe592c21f452852c29ed42..783d651a354aec43c33be265313e660d1c167bcd 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php @@ -2445,7 +2445,7 @@ return [ 'Deprecation-85558-ContentObjectRenderer-enableFields.rst' ], ], - 'TYPO3\CMS\Scheduler\Classes\Controller\SchedulerModuleController->addMessage' => [ + 'TYPO3\CMS\Scheduler\Controller\SchedulerModuleController->addMessage' => [ 'numberOfMandatoryArguments' => 1, 'maximumNumberOfArguments' => 2, 'restFiles' => [ @@ -2473,4 +2473,11 @@ return [ 'Deprecation-65578-ConfigconcatenateJsAndCssAndConcatenateFiles.rst', ], ], + 'TYPO3\CMS\Frontend\Page\PageRepository->checkWorkspaceAccess' => [ + 'numberOfMandatoryArguments' => 1, + 'maximumNumberOfArguments' => 1, + 'restFiles' => [ + 'Deprecation-85554-PageRepository-checkWorkspaceAccess.rst', + ], + ], ];