diff --git a/typo3/sysext/backend/Classes/Controller/BackendController.php b/typo3/sysext/backend/Classes/Controller/BackendController.php index 7078dc39a84f3a7dc5c91c867ab932f7919a323a..635e59015abf9ca1f959bdd0056fa4bb9a5da4ef 100644 --- a/typo3/sysext/backend/Classes/Controller/BackendController.php +++ b/typo3/sysext/backend/Classes/Controller/BackendController.php @@ -430,7 +430,7 @@ class BackendController $editId = preg_replace('/[^[:alnum:]_]/', '', GeneralUtility::_GET('edit')); if ($editId) { // Looking up the page to edit, checking permissions: - $where = ' AND (' . $beUser->getPagePermsClause(2) . ' OR ' . $beUser->getPagePermsClause(16) . ')'; + $where = ' AND (' . $beUser->getPagePermsClause(Permission::PAGE_EDIT) . ' OR ' . $beUser->getPagePermsClause(Permission::CONTENT_EDIT) . ')'; if (MathUtility::canBeInterpretedAsInteger($editId)) { $editRecord = BackendUtility::getRecordWSOL('pages', $editId, '*', $where); } else { diff --git a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php index 0b354ad503d21cc107da87236dda9129b99ba054..8e5293152e45166eeacef6f0c8b15b719d2fcf53 100644 --- a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php +++ b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php @@ -22,6 +22,7 @@ use TYPO3\CMS\Backend\Template\ModuleTemplate; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\History\RecordHistoryStore; use TYPO3\CMS\Core\Imaging\Icon; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\DiffUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\View\StandaloneView; @@ -128,7 +129,7 @@ class ElementHistoryController if ($elementData[0] !== 'pages') { $this->view->assign('singleElement', true); $parentPage = BackendUtility::getRecord($elementData[0], $elementData[1], '*', '', false); - if ($parentPage['pid'] > 0 && BackendUtility::readPageAccess($parentPage['pid'], $this->getBackendUser()->getPagePermsClause(1))) { + if ($parentPage['pid'] > 0 && BackendUtility::readPageAccess($parentPage['pid'], $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW))) { $this->view->assign('fullHistoryUrl', $this->buildUrl([ 'element' => 'pages:' . $parentPage['pid'], 'historyEntry' => '', @@ -166,7 +167,7 @@ class ElementHistoryController $pageId = $record['pid']; } - $pageAccess = BackendUtility::readPageAccess($pageId, $this->getBackendUser()->getPagePermsClause(1)); + $pageAccess = BackendUtility::readPageAccess($pageId, $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW)); if (is_array($pageAccess)) { $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($pageAccess); } diff --git a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php index 0b1ca8c46ea35d7018e757cfdc761d006bcfe8b6..2a40d2d2c62b8e2263edd36c888e559a59c9b2fd 100644 --- a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php +++ b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php @@ -25,6 +25,7 @@ use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Resource\AbstractFile; use TYPO3\CMS\Core\Resource\Folder; use TYPO3\CMS\Core\Resource\ResourceFactory; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\View\StandaloneView; @@ -121,7 +122,7 @@ class ElementInformationController $this->table = GeneralUtility::_GET('table'); $this->uid = GeneralUtility::_GET('uid'); - $this->permsClause = $this->getBackendUser()->getPagePermsClause(1); + $this->permsClause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW); $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class); $this->moduleTemplate->getDocHeaderComponent()->disable(); diff --git a/typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php b/typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php index 615047515ebda7340ff856f0fff3b3bfa3ea31bc..c33c43d5c61bb67a9b5d37d92e874d49e90bb92a 100644 --- a/typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php +++ b/typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php @@ -21,6 +21,7 @@ use TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap; use TYPO3\CMS\Backend\Tree\View\PageMovingPagePositionMap; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Imaging\Icon; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\View\StandaloneView; @@ -110,7 +111,7 @@ class MoveElementController $this->moveUid = $this->input_moveUid ? $this->input_moveUid : $this->page_id; $this->makeCopy = GeneralUtility::_GP('makeCopy'); // Select-pages where clause for read-access: - $this->perms_clause = $this->getBackendUser()->getPagePermsClause(1); + $this->perms_clause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW); } /** diff --git a/typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php b/typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php index d128935721d69f84133a34278afd496a690c2edd..690a3230b83b2eff5dc0e16ecef7349f912901ff 100644 --- a/typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php +++ b/typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php @@ -23,6 +23,7 @@ use TYPO3\CMS\Backend\View\BackendLayoutView; use TYPO3\CMS\Backend\Wizard\NewContentElementWizardHookInterface; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Service\DependencyOrderingService; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\View\StandaloneView; @@ -172,7 +173,7 @@ class NewContentElementController // Setting up the context sensitive menu: $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ContextMenu'); // Getting the current page and receiving access information (used in main()) - $perms_clause = $this->getBackendUser()->getPagePermsClause(1); + $perms_clause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW); $this->pageInfo = BackendUtility::readPageAccess($this->id, $perms_clause); $this->access = is_array($this->pageInfo); } diff --git a/typo3/sysext/backend/Classes/Controller/NewRecordController.php b/typo3/sysext/backend/Classes/Controller/NewRecordController.php index 0afe4c42a29d72109c98a09c62c4561befbd19fd..fa517c5560c0c5c04d2b9a67494e9acb426dfe25 100644 --- a/typo3/sysext/backend/Classes/Controller/NewRecordController.php +++ b/typo3/sysext/backend/Classes/Controller/NewRecordController.php @@ -25,6 +25,7 @@ use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; use TYPO3\CMS\Core\Imaging\Icon; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\HttpUtility; @@ -172,7 +173,7 @@ class NewRecordController { $beUser = $this->getBackendUserAuthentication(); // Page-selection permission clause (reading) - $this->perms_clause = $beUser->getPagePermsClause(1); + $this->perms_clause = $beUser->getPagePermsClause(Permission::PAGE_SHOW); // This will hide records from display - it has nothing to do with user rights!! if ($pidList = $beUser->getTSConfigVal('options.hideRecords.pages')) { if (!empty($pidList)) { diff --git a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php index e89a693d82294cb0803d5ada38b909c507b74e5c..0fb07088e2cd96ff4bc204dd0bac0a7947eb1e90 100644 --- a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php +++ b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php @@ -257,7 +257,7 @@ class PageLayoutController $this->getLanguageService()->includeLLFile('EXT:backend/Resources/Private/Language/locallang_layout.xlf'); // Setting module configuration / page select clause $this->MCONF['name'] = $this->moduleName; - $this->perms_clause = $this->getBackendUser()->getPagePermsClause(1); + $this->perms_clause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW); // Get session data $sessionData = $this->getBackendUser()->getSessionData(RecordList::class); $this->search_field = !empty($sessionData['search_field']) ? $sessionData['search_field'] : ''; diff --git a/typo3/sysext/backend/Classes/Controller/Wizard/NewContentElementWizardController.php b/typo3/sysext/backend/Classes/Controller/Wizard/NewContentElementWizardController.php index 57555c66956a19cb6afc296a74224ae1ee7deed7..2e7df1414752307f0dc886eb9eeb07fda3891a39 100644 --- a/typo3/sysext/backend/Classes/Controller/Wizard/NewContentElementWizardController.php +++ b/typo3/sysext/backend/Classes/Controller/Wizard/NewContentElementWizardController.php @@ -27,6 +27,7 @@ use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Service\DependencyOrderingService; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\View\StandaloneView; @@ -188,7 +189,7 @@ class NewContentElementWizardController $configuration = BackendUtility::getPagesTSconfig($this->id); $this->configuration = $configuration['mod.']['wizards.']['newContentElement.']; // Getting the current page and receiving access information (used in main()) - $permissionsClause = $this->getBackendUser()->getPagePermsClause(1); + $permissionsClause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW); $this->pageInfo = BackendUtility::readPageAccess($this->id, $permissionsClause); $this->access = is_array($this->pageInfo); } diff --git a/typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php b/typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php index 940eb7b1d662077e33cfd5c2d08bca882b6438a0..4c88ba724b0c8a116ac6266650c4cfd24bc61a6f 100644 --- a/typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php +++ b/typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php @@ -411,7 +411,7 @@ class InlineRecordContainer extends AbstractContainer $nameObject = $this->inlineStackProcessor->getCurrentStructureDomObjectIdPrefix($data['inlineFirstPid']); $nameObjectFt = $nameObject . '-' . $foreignTable; $nameObjectFtId = $nameObjectFt . '-' . $rec['uid']; - $calcPerms = $backendUser->calcPerms(BackendUtility::readPageAccess($rec['pid'], $backendUser->getPagePermsClause(1))); + $calcPerms = $backendUser->calcPerms(BackendUtility::readPageAccess($rec['pid'], $backendUser->getPagePermsClause(Permission::PAGE_SHOW))); // If the listed table is 'pages' we have to request the permission settings for each page: $localCalcPerms = false; if ($isPagesTable) { diff --git a/typo3/sysext/backend/Classes/Form/Container/OuterWrapContainer.php b/typo3/sysext/backend/Classes/Form/Container/OuterWrapContainer.php index 44ef896167d9f91954edce8ec0163ebb31632390..52a189e3231103f510063d347adaa8f4f0adad54 100644 --- a/typo3/sysext/backend/Classes/Form/Container/OuterWrapContainer.php +++ b/typo3/sysext/backend/Classes/Form/Container/OuterWrapContainer.php @@ -19,6 +19,7 @@ use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Localization\LanguageService; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\View\StandaloneView; @@ -58,7 +59,7 @@ class OuterWrapContainer extends AbstractContainer $recordPath = ''; // @todo: what is this >= 0 check for? wsol cases?! if ($this->data['effectivePid'] >= 0) { - $permissionsClause = $backendUser->getPagePermsClause(1); + $permissionsClause = $backendUser->getPagePermsClause(Permission::PAGE_SHOW); $recordPath = BackendUtility::getRecordPath($this->data['effectivePid'], $permissionsClause, 15); } diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php index 8601df52f36db567e50d9e206cbcddaa8e815f01..f961d5d87b9c5d01916328d39feac8c4f6b6493d 100644 --- a/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php +++ b/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php @@ -33,6 +33,7 @@ use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\FlashMessageQueue; use TYPO3\CMS\Core\Messaging\FlashMessageService; use TYPO3\CMS\Core\Resource\FileRepository; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; @@ -1014,7 +1015,7 @@ abstract class AbstractItemProvider ) ); } else { - $queryBuilder->andWhere($backendUser->getPagePermsClause(1)); + $queryBuilder->andWhere($backendUser->getPagePermsClause(Permission::PAGE_SHOW)); if ($foreignTableName !== 'pages') { $queryBuilder ->from('pages') diff --git a/typo3/sysext/backend/Classes/Form/Wizard/SuggestWizardDefaultReceiver.php b/typo3/sysext/backend/Classes/Form/Wizard/SuggestWizardDefaultReceiver.php index abe989dc6743bcece0c7303b69cfcb244116d8d9..77573dfd5c5ea1b0e7394462a1fccd72a78b53de 100644 --- a/typo3/sysext/backend/Classes/Form/Wizard/SuggestWizardDefaultReceiver.php +++ b/typo3/sysext/backend/Classes/Form/Wizard/SuggestWizardDefaultReceiver.php @@ -24,6 +24,7 @@ use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Localization\LanguageService; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -119,7 +120,7 @@ class SuggestWizardDefaultReceiver } if ($this->table === 'pages') { $this->queryBuilder->andWhere( - QueryHelper::stripLogicalOperatorPrefix($GLOBALS['BE_USER']->getPagePermsClause(1)) + QueryHelper::stripLogicalOperatorPrefix($GLOBALS['BE_USER']->getPagePermsClause(Permission::PAGE_SHOW)) ); } if (isset($config['addWhere'])) { @@ -322,13 +323,13 @@ class SuggestWizardDefaultReceiver $retValue = true; $table = $this->mmForeignTable ?: $this->table; if ($table === 'pages') { - if (!BackendUtility::readPageAccess($uid, $GLOBALS['BE_USER']->getPagePermsClause(1))) { + if (!BackendUtility::readPageAccess($uid, $GLOBALS['BE_USER']->getPagePermsClause(Permission::PAGE_SHOW))) { $retValue = false; } } elseif (isset($GLOBALS['TCA'][$table]['ctrl']['is_static']) && (bool)$GLOBALS['TCA'][$table]['ctrl']['is_static']) { $retValue = true; } else { - if (!is_array(BackendUtility::readPageAccess($row['pid'], $GLOBALS['BE_USER']->getPagePermsClause(1)))) { + if (!is_array(BackendUtility::readPageAccess($row['pid'], $GLOBALS['BE_USER']->getPagePermsClause(Permission::PAGE_SHOW)))) { $retValue = false; } } diff --git a/typo3/sysext/backend/Classes/Module/BaseScriptClass.php b/typo3/sysext/backend/Classes/Module/BaseScriptClass.php index b5d900bca3085f3b8d439b9833118af4949bdfee..43b944953b258754bfb61553f443ee0c10f44244 100644 --- a/typo3/sysext/backend/Classes/Module/BaseScriptClass.php +++ b/typo3/sysext/backend/Classes/Module/BaseScriptClass.php @@ -20,6 +20,7 @@ use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\FlashMessageService; use TYPO3\CMS\Core\Page\PageRenderer; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -198,7 +199,7 @@ class BaseScriptClass } $this->id = (int)GeneralUtility::_GP('id'); $this->CMD = GeneralUtility::_GP('CMD'); - $this->perms_clause = $this->getBackendUser()->getPagePermsClause(1); + $this->perms_clause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW); $this->menuConfig(); $this->handleExternalFunctionValue(); } diff --git a/typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php b/typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php index ed266303389fffe503af3942c2f412521cb46d26..54f86361a27d437ad2cae2949bf9ddd50e90b773 100644 --- a/typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php +++ b/typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php @@ -82,7 +82,7 @@ class LiveSearch */ public function __construct() { - $this->userPermissions = $GLOBALS['BE_USER']->getPagePermsClause(1); + $this->userPermissions = $GLOBALS['BE_USER']->getPagePermsClause(Permission::PAGE_SHOW); $this->queryParser = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Search\LiveSearch\QueryParser::class); } diff --git a/typo3/sysext/backend/Classes/Tree/View/BrowseTreeView.php b/typo3/sysext/backend/Classes/Tree/View/BrowseTreeView.php index a6298979e7f04b47b5fd8653306bd3a7c3100c45..3fcce8daa29fc68df63963a81ad07939797b3ef2 100644 --- a/typo3/sysext/backend/Classes/Tree/View/BrowseTreeView.php +++ b/typo3/sysext/backend/Classes/Tree/View/BrowseTreeView.php @@ -16,6 +16,7 @@ namespace TYPO3\CMS\Backend\Tree\View; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Database\ConnectionPool; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -88,7 +89,7 @@ class BrowseTreeView extends AbstractTreeView } } // This is very important for making trees of pages: Filtering out deleted pages, pages with no access to and sorting them correctly: - parent::init(' AND ' . $this->getBackendUser()->getPagePermsClause(1) . ' ' . $clause . $clauseExcludePidList, 'sorting'); + parent::init(' AND ' . $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW) . ' ' . $clause . $clauseExcludePidList, 'sorting'); $this->title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']; $this->MOUNTS = $this->getBackendUser()->returnWebmounts(); if ($pidList) { diff --git a/typo3/sysext/backend/Classes/View/PageLayoutView.php b/typo3/sysext/backend/Classes/View/PageLayoutView.php index a09d1084c8e00e1568fda500971f19371435e027..e7da3f0bf82a76e6eb4ef46a210140fd87e2539b 100644 --- a/typo3/sysext/backend/Classes/View/PageLayoutView.php +++ b/typo3/sysext/backend/Classes/View/PageLayoutView.php @@ -715,7 +715,7 @@ class PageLayoutView implements LoggerAwareInterface ->from('pages') ->where( $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($id, \PDO::PARAM_INT)), - $this->getBackendUser()->getPagePermsClause(1) + $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW) ) ->execute() ->fetch(); @@ -1664,7 +1664,7 @@ class PageLayoutView implements LoggerAwareInterface ->where( $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($pid, \PDO::PARAM_INT)), $queryBuilder->expr()->eq('sys_language_uid', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)), - $this->getBackendUser()->getPagePermsClause(1) + $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW) ); if (!empty($GLOBALS['TCA']['pages']['ctrl']['sortby'])) { @@ -3000,7 +3000,7 @@ class PageLayoutView implements LoggerAwareInterface $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable('pages') ->expr(); - $permsClause = $expressionBuilder->andX($backendUser->getPagePermsClause(1)); + $permsClause = $expressionBuilder->andX($backendUser->getPagePermsClause(Permission::PAGE_SHOW)); // This will hide records from display - it has nothing to do with user rights!! if ($pidList = $backendUser->getTSConfigVal('options.hideRecords.pages')) { $pidList = GeneralUtility::intExplode(',', $pidList, true); diff --git a/typo3/sysext/belog/Classes/Domain/Repository/LogEntryRepository.php b/typo3/sysext/belog/Classes/Domain/Repository/LogEntryRepository.php index 5aacb46e0bf8740b504c6e94eca9e61bfb332237..c9874bf46d545646668851efe38c156a9429c814 100644 --- a/typo3/sysext/belog/Classes/Domain/Repository/LogEntryRepository.php +++ b/typo3/sysext/belog/Classes/Domain/Repository/LogEntryRepository.php @@ -15,6 +15,7 @@ namespace TYPO3\CMS\Belog\Domain\Repository; */ use TYPO3\CMS\Belog\Domain\Model\LogEntry; use TYPO3\CMS\Core\Database\ConnectionPool; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -108,7 +109,7 @@ class LogEntryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository if ($constraint->getDepth() > 0) { /** @var $pageTree \TYPO3\CMS\Backend\Tree\View\PageTreeView */ $pageTree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Tree\View\PageTreeView::class); - $pageTree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1)); + $pageTree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(Permission::PAGE_SHOW)); $pageTree->makeHTML = 0; $pageTree->fieldArray = ['uid']; $pageTree->getTree($constraint->getPageId(), $constraint->getDepth()); diff --git a/typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php b/typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php index 3bfcedf94941addb3ccfe621132e6a670bad3c31..28102b74488aa5d3cb024e25cb18c4dede1439c3 100644 --- a/typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php +++ b/typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php @@ -383,7 +383,7 @@ class BackendUserAuthentication extends AbstractUserAuthentication $id = (int)$checkRec['t3ver_oid']; } if (!$readPerms) { - $readPerms = $this->getPagePermsClause(1); + $readPerms = $this->getPagePermsClause(Permission::PAGE_SHOW); } if ($id > 0) { $wM = $this->returnWebmounts(); @@ -1413,7 +1413,7 @@ class BackendUserAuthentication extends AbstractUserAuthentication ->from('pages') // @todo DOCTRINE: check how to make getPagePermsClause() portable ->where( - $this->getPagePermsClause(1), + $this->getPagePermsClause(Permission::PAGE_SHOW), $queryBuilder->expr()->in( 'uid', $queryBuilder->createNamedParameter( diff --git a/typo3/sysext/core/Classes/Database/QueryGenerator.php b/typo3/sysext/core/Classes/Database/QueryGenerator.php index 876a80beb7c4d7417631fbebd936e7963d08e302..0c9583872c94216fdd65165096a94da3bd2af969 100644 --- a/typo3/sysext/core/Classes/Database/QueryGenerator.php +++ b/typo3/sysext/core/Classes/Database/QueryGenerator.php @@ -20,6 +20,7 @@ use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Database\Query\QueryHelper; use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; use TYPO3\CMS\Core\Localization\LanguageService; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\StringUtility; @@ -936,7 +937,7 @@ class QueryGenerator ->orderBy('uid'); if (!$backendUserAuthentication->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts']) { $webMounts = $backendUserAuthentication->returnWebmounts(); - $perms_clause = $backendUserAuthentication->getPagePermsClause(1); + $perms_clause = $backendUserAuthentication->getPagePermsClause(Permission::PAGE_SHOW); $webMountPageTree = ''; $webMountPageTreePrefix = ''; foreach ($webMounts as $webMount) { @@ -1615,7 +1616,7 @@ class QueryGenerator if (!$backendUserAuthentication->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts']) { $webMounts = $backendUserAuthentication->returnWebmounts(); - $perms_clause = $backendUserAuthentication->getPagePermsClause(1); + $perms_clause = $backendUserAuthentication->getPagePermsClause(Permission::PAGE_SHOW); $webMountPageTree = ''; $webMountPageTreePrefix = ''; foreach ($webMounts as $webMount) { diff --git a/typo3/sysext/core/Classes/Database/QueryView.php b/typo3/sysext/core/Classes/Database/QueryView.php index 8acc21c2911bed4b65c0345fe4aea29988fe1362..0b1742bd3752607b4218048a1f35cb59003018a4 100644 --- a/typo3/sysext/core/Classes/Database/QueryView.php +++ b/typo3/sysext/core/Classes/Database/QueryView.php @@ -24,6 +24,7 @@ use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\FlashMessageRendererResolver; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\CsvUtility; use TYPO3\CMS\Core\Utility\DebugUtility; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; @@ -1072,7 +1073,7 @@ class QueryView ->orderBy('uid'); if (!$this->backendUserAuthentication->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts']) { $webMounts = $this->backendUserAuthentication->returnWebmounts(); - $perms_clause = $this->backendUserAuthentication->getPagePermsClause(1); + $perms_clause = $this->backendUserAuthentication->getPagePermsClause(Permission::PAGE_SHOW); $webMountPageTree = ''; $webMountPageTreePrefix = ''; foreach ($webMounts as $webMount) { diff --git a/typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php b/typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php index a440c8ebe8b7b3842f1d4f606bb49588c6db0c4d..7782f9f09d23c63417f1f431fbe5c3f45403e33b 100644 --- a/typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php +++ b/typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php @@ -18,6 +18,7 @@ use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction; use TYPO3\CMS\Core\Database\QueryGenerator; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\TypoScript\TemplateService; use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -258,7 +259,7 @@ class BackendConfigurationManager extends AbstractConfigurationManager $recursiveStoragePids = ''; $storagePids = GeneralUtility::intExplode(',', $storagePid); - $permsClause = $this->getBackendUser()->getPagePermsClause(1); + $permsClause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW); $queryGenerator = GeneralUtility::makeInstance(QueryGenerator::class); foreach ($storagePids as $startPid) { $pids = $queryGenerator->getTreeList($startPid, $recursionDepth, 0, $permsClause); diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/PageInfoViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/PageInfoViewHelper.php index 16941ea7d9259b801586df4fdf6a68571453e315..7c9d906f2925375e79bdc153267159b0b0d1cf1f 100644 --- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/PageInfoViewHelper.php +++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/PageInfoViewHelper.php @@ -17,6 +17,7 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; @@ -68,7 +69,7 @@ class PageInfoViewHelper extends AbstractBackendViewHelper public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) { $id = GeneralUtility::_GP('id'); - $pageRecord = BackendUtility::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(1)); + $pageRecord = BackendUtility::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(Permission::PAGE_SHOW)); // Add icon with context menu, etc: /** @var IconFactory $iconFactory */ $iconFactory = GeneralUtility::makeInstance(IconFactory::class); diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/PagePathViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/PagePathViewHelper.php index a00c9834158a2010ef61d1de81327f91aef6c382..b32fddf954223684f8beb0357f3a70e619fb1911 100644 --- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/PagePathViewHelper.php +++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/PagePathViewHelper.php @@ -15,6 +15,7 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be; */ use TYPO3\CMS\Backend\Utility\BackendUtility; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; @@ -66,7 +67,7 @@ class PagePathViewHelper extends AbstractBackendViewHelper public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) { $id = GeneralUtility::_GP('id'); - $pageRecord = BackendUtility::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(1)); + $pageRecord = BackendUtility::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(Permission::PAGE_SHOW)); // Is this a real page if ($pageRecord['uid']) { $title = $pageRecord['_thePathFull']; diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Be/TableListViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Be/TableListViewHelper.php index e213a580db886f9f453bb38e98007ba32d29bfd2..8b36cf50a340c6869baac2159d5080740a37982d 100644 --- a/typo3/sysext/fluid/Classes/ViewHelpers/Be/TableListViewHelper.php +++ b/typo3/sysext/fluid/Classes/ViewHelpers/Be/TableListViewHelper.php @@ -15,6 +15,7 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be; */ use TYPO3\CMS\Backend\Utility\BackendUtility; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -107,7 +108,7 @@ class TableListViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBacken $this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Recordlist/Recordlist'); - $pageinfo = BackendUtility::readPageAccess(GeneralUtility::_GP('id'), $GLOBALS['BE_USER']->getPagePermsClause(1)); + $pageinfo = BackendUtility::readPageAccess(GeneralUtility::_GP('id'), $GLOBALS['BE_USER']->getPagePermsClause(Permission::PAGE_SHOW)); /** @var $dblist \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList */ $dblist = GeneralUtility::makeInstance(\TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::class); $dblist->pageRow = $pageinfo; diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php index a34872b4f2283abbddab88ca18be3af0758dde56..1f2a60d0a87aaa5f170928e4112070d24461392c 100644 --- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php +++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php @@ -40,6 +40,7 @@ use TYPO3\CMS\Core\Page\PageRenderer; use TYPO3\CMS\Core\Resource\StorageRepository; use TYPO3\CMS\Core\Service\DependencyOrderingService; use TYPO3\CMS\Core\TimeTracker\TimeTracker; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser; use TYPO3\CMS\Core\TypoScript\TemplateService; use TYPO3\CMS\Core\Utility\ArrayUtility; @@ -1626,7 +1627,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface 'uid', $queryBuilder->createNamedParameter($this->id, \PDO::PARAM_INT) ), - $this->getBackendUser()->getPagePermsClause(1) + $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW) ) ->execute() ->fetch(); diff --git a/typo3/sysext/frontend/Classes/View/AdminPanelView.php b/typo3/sysext/frontend/Classes/View/AdminPanelView.php index baaa599cb9a134cf76092204cff247ded03de783..33afc1a471690e43256562003d5f3f58f7619315 100644 --- a/typo3/sysext/frontend/Classes/View/AdminPanelView.php +++ b/typo3/sysext/frontend/Classes/View/AdminPanelView.php @@ -165,7 +165,7 @@ class AdminPanelView 'clearCacheLevels' ), 0, - $beUser->getPagePermsClause(1) + $beUser->getPagePermsClause(Permission::PAGE_SHOW) ) . $theStartId ); } @@ -480,7 +480,7 @@ class AdminPanelView ->from('pages') ->where( $queryBuilder->expr()->eq('pages.uid', $queryBuilder->quoteIdentifier('fe_groups.pid')), - $this->getBackendUser()->getPagePermsClause(1) + $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW) ) ->execute() ->fetchColumn(0); @@ -490,7 +490,7 @@ class AdminPanelView ->from('pages') ->where( $queryBuilder->expr()->eq('pages.uid', $queryBuilder->quoteIdentifier('fe_groups.pid')), - $this->getBackendUser()->getPagePermsClause(1) + $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW) ) ->orderBy('fe_groups.title') ->execute(); diff --git a/typo3/sysext/impexp/Classes/ImportExport.php b/typo3/sysext/impexp/Classes/ImportExport.php index bff40086c3c2d30df3d7efcd21576205fcec5574..f0c1e2b20a157ad9aeca25ea708b71842c7f6471 100644 --- a/typo3/sysext/impexp/Classes/ImportExport.php +++ b/typo3/sysext/impexp/Classes/ImportExport.php @@ -21,6 +21,7 @@ use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException; use TYPO3\CMS\Core\Resource\ResourceFactory; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\DebugUtility; use TYPO3\CMS\Core\Utility\DiffUtility; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; @@ -1088,7 +1089,7 @@ abstract class ImportExport public function getRecordPath($pid) { if (!isset($this->cache_getRecordPath[$pid])) { - $clause = $this->getBackendUser()->getPagePermsClause(1); + $clause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW); $this->cache_getRecordPath[$pid] = (string)BackendUtility::getRecordPath($pid, $clause, 20); } return $this->cache_getRecordPath[$pid]; diff --git a/typo3/sysext/impexp/Classes/Task/ImportExportTask.php b/typo3/sysext/impexp/Classes/Task/ImportExportTask.php index e524a7317fa0f39e4bce68e734f5e6f04e4f515d..568307c5ded8888764d5ecd26eaa895410ddab0c 100644 --- a/typo3/sysext/impexp/Classes/Task/ImportExportTask.php +++ b/typo3/sysext/impexp/Classes/Task/ImportExportTask.php @@ -19,6 +19,7 @@ use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\FlashMessageService; use TYPO3\CMS\Core\Resource\Exception; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Taskcenter\Controller\TaskModuleController; use TYPO3\CMS\Taskcenter\TaskInterface; @@ -104,7 +105,7 @@ class ImportExportTask implements TaskInterface // Header $lang = $this->getLanguageService(); $content .= $this->taskObject->description($lang->getLL('.alttitle'), $lang->getLL('.description')); - $clause = $this->getBackendUser()->getPagePermsClause(1); + $clause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW); $usernames = BackendUtility::getUserNames(); // Create preset links: $presets = $this->getPresets(); diff --git a/typo3/sysext/impexp/Classes/View/ExportPageTreeView.php b/typo3/sysext/impexp/Classes/View/ExportPageTreeView.php index 89535969d619d77d4728cfc218e8e3bd2704d1cb..4d9d073bf05c14dafebd7eea30c74b8f6483f97c 100644 --- a/typo3/sysext/impexp/Classes/View/ExportPageTreeView.php +++ b/typo3/sysext/impexp/Classes/View/ExportPageTreeView.php @@ -18,6 +18,7 @@ use TYPO3\CMS\Backend\Tree\View\BrowseTreeView; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -84,7 +85,7 @@ class ExportPageTreeView extends BrowseTreeView public function ext_tree($pid, $clause = '') { // Initialize: - $this->init(' AND ' . $this->BE_USER->getPagePermsClause(1) . $clause); + $this->init(' AND ' . $this->BE_USER->getPagePermsClause(Permission::PAGE_SHOW) . $clause); // Get stored tree structure: $this->stored = unserialize($this->BE_USER->uc['browseTrees']['browsePages'], ['allowed_classes' => false]); $treeArr = []; diff --git a/typo3/sysext/indexed_search/Classes/Controller/AdministrationController.php b/typo3/sysext/indexed_search/Classes/Controller/AdministrationController.php index 9cbab0a8c2a4d21277f5b1d35d54addfc5f4b8e7..c1b922f272576f388e7d19a9d3d8ce98dfe4bfaf 100644 --- a/typo3/sysext/indexed_search/Classes/Controller/AdministrationController.php +++ b/typo3/sysext/indexed_search/Classes/Controller/AdministrationController.php @@ -20,6 +20,7 @@ use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Localization\LanguageService; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use TYPO3\CMS\Extbase\Mvc\View\ViewInterface; @@ -89,7 +90,7 @@ class AdministrationController extends ActionController if ($view instanceof BackendTemplateView) { /** @var BackendTemplateView $view */ parent::initializeView($view); - $permissionClause = $this->getBackendUserAuthentication()->getPagePermsClause(1); + $permissionClause = $this->getBackendUserAuthentication()->getPagePermsClause(Permission::PAGE_SHOW); $pageRecord = BackendUtility::readPageAccess($this->pageUid, $permissionClause); if ($pageRecord) { $view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation($pageRecord); diff --git a/typo3/sysext/indexed_search/Classes/Domain/Repository/AdministrationRepository.php b/typo3/sysext/indexed_search/Classes/Domain/Repository/AdministrationRepository.php index 1c1db69582829e47a533d6864f391ed664c698c1..98f2f2266c5bf2221cc2e91a2764c557a6449be3 100644 --- a/typo3/sysext/indexed_search/Classes/Domain/Repository/AdministrationRepository.php +++ b/typo3/sysext/indexed_search/Classes/Domain/Repository/AdministrationRepository.php @@ -25,6 +25,7 @@ use TYPO3\CMS\Core\Database\Query\QueryHelper; use TYPO3\CMS\Core\DataHandling\DataHandler; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\IndexedSearch\FileContentParser; @@ -464,7 +465,7 @@ class AdministrationRepository } /** @var PageTreeView $tree */ $tree = GeneralUtility::makeInstance(PageTreeView::class); - $perms_clause = $this->getBackendUserAuthentication()->getPagePermsClause(1); + $perms_clause = $this->getBackendUserAuthentication()->getPagePermsClause(Permission::PAGE_SHOW); $tree->init('AND ' . $perms_clause); $iconFactory = GeneralUtility::makeInstance(IconFactory::class); $HTML = '<span title="' . htmlspecialchars($pageRecord['title']) . '">' . $iconFactory->getIconForRecord('pages', $pageRecord, Icon::SIZE_SMALL)->render() . '</span>'; diff --git a/typo3/sysext/info/Classes/Controller/TranslationStatusController.php b/typo3/sysext/info/Classes/Controller/TranslationStatusController.php index c44e63c9b3f3a3765e3100496f51a4ff9e9696b0..e87684dcec05b212c4cbd4b6e58f5956c3c16dcf 100644 --- a/typo3/sysext/info/Classes/Controller/TranslationStatusController.php +++ b/typo3/sysext/info/Classes/Controller/TranslationStatusController.php @@ -22,6 +22,7 @@ use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction; use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -95,7 +96,7 @@ class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunc $depth = $this->pObj->MOD_SETTINGS['depth']; // Initialize tree object: $tree = GeneralUtility::makeInstance(PageTreeView::class); - $tree->init('AND ' . $this->getBackendUser()->getPagePermsClause(1)); + $tree->init('AND ' . $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW)); $tree->addField('l18n_cfg'); // Creating top icon; the current page $HTML = $this->iconFactory->getIconForRecord('pages', $treeStartingRecord, Icon::SIZE_SMALL)->render(); diff --git a/typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php b/typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php index b0a8cb4d635ab58646b094a53b3b2fbcfcdc4d7b..7b6cbdf3d484a2f08e93d3bbe66caf79d5fc2b24 100644 --- a/typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php +++ b/typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php @@ -25,6 +25,7 @@ use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\FlashMessageService; use TYPO3\CMS\Core\Service\MarkerBasedTemplateService; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Linkvalidator\LinkAnalyzer; @@ -240,7 +241,7 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class); $this->doc->setModuleTemplate('EXT:linkvalidator/Resources/Private/Templates/mod_template.html'); - $this->pageRecord = BackendUtility::readPageAccess($this->pObj->id, $this->getBackendUser()->getPagePermsClause(1)); + $this->pageRecord = BackendUtility::readPageAccess($this->pObj->id, $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW)); if ($this->pObj->id && is_array($this->pageRecord) || !$this->pObj->id && $this->isCurrentUserAdmin()) { $this->isAccessibleForCurrentUser = true; } @@ -279,7 +280,7 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu $this->pObj->id, $this->searchLevel, 0, - $this->getBackendUser()->getPagePermsClause(1), + $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW), $this->modTS['checkhidden'] ); if ($this->pObj->pageinfo['hidden'] == 0 || $this->modTS['checkhidden']) { @@ -431,7 +432,7 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu $currentPageUid, $this->searchLevel, 0, - $this->getBackendUser()->getPagePermsClause(1), + $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW), $this->modTS['checkhidden'] ); // Always add the current page, because we are just displaying the results diff --git a/typo3/sysext/recordlist/Classes/Browser/DatabaseBrowser.php b/typo3/sysext/recordlist/Classes/Browser/DatabaseBrowser.php index ec5a96954465864d71065107d674c35e2bd4051e..2a6285c707b2bbdfcc84a0f40bc84df905aa8d39 100644 --- a/typo3/sysext/recordlist/Classes/Browser/DatabaseBrowser.php +++ b/typo3/sysext/recordlist/Classes/Browser/DatabaseBrowser.php @@ -17,6 +17,7 @@ namespace TYPO3\CMS\Recordlist\Browser; use TYPO3\CMS\Backend\RecordList\ElementBrowserRecordList; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Imaging\Icon; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Recordlist\Tree\View\ElementBrowserPageTreeView; @@ -230,7 +231,7 @@ class DatabaseBrowser extends AbstractElementBrowser implements ElementBrowserIn $out .= '<br />'; } - $permsClause = $backendUser->getPagePermsClause(1); + $permsClause = $backendUser->getPagePermsClause(Permission::PAGE_SHOW); $pageInfo = BackendUtility::readPageAccess($this->expandPage, $permsClause); /** @var ElementBrowserRecordList $dbList */ diff --git a/typo3/sysext/recordlist/Classes/RecordList.php b/typo3/sysext/recordlist/Classes/RecordList.php index feb487a1ab61f344ad23e1d2270eac233a47e345..d2afff33733d9465dca1186c1d3e1671cb3886da 100644 --- a/typo3/sysext/recordlist/Classes/RecordList.php +++ b/typo3/sysext/recordlist/Classes/RecordList.php @@ -215,7 +215,7 @@ class RecordList { $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class); $backendUser = $this->getBackendUserAuthentication(); - $this->perms_clause = $backendUser->getPagePermsClause(1); + $this->perms_clause = $backendUser->getPagePermsClause(Permission::PAGE_SHOW); // Get session data $sessionData = $backendUser->getSessionData(__CLASS__); $this->search_field = !empty($sessionData['search_field']) ? $sessionData['search_field'] : ''; diff --git a/typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php b/typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php index 08980b88bdf49ff9508218d8366cdfacdbbed2b6..da4b14ae3f42e66f15cc202f502e101045a084f5 100644 --- a/typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php +++ b/typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php @@ -433,7 +433,7 @@ class AbstractDatabaseRecordList extends AbstractRecordList $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable('pages') ->expr(); - $permsClause = $expressionBuilder->andX($backendUser->getPagePermsClause(1)); + $permsClause = $expressionBuilder->andX($backendUser->getPagePermsClause(Permission::PAGE_SHOW)); // This will hide records from display - it has nothing to do with user rights!! if ($pidList = $backendUser->getTSConfigVal('options.hideRecords.pages')) { $pidList = GeneralUtility::intExplode(',', $pidList, true); diff --git a/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php b/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php index 34ce004fc927c3d30429ab8b4d5174e9f64acab1..ae03dfd2c240b84701ef3e8732dbe109031cac9f 100644 --- a/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php +++ b/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php @@ -2863,7 +2863,7 @@ class DatabaseRecordList $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable('pages') ->expr(); - $permsClause = $expressionBuilder->andX($backendUser->getPagePermsClause(1)); + $permsClause = $expressionBuilder->andX($backendUser->getPagePermsClause(Permission::PAGE_SHOW)); // This will hide records from display - it has nothing to do with user rights!! if ($pidList = $backendUser->getTSConfigVal('options.hideRecords.pages')) { $pidList = GeneralUtility::intExplode(',', $pidList, true); diff --git a/typo3/sysext/recycler/Classes/Controller/RecyclerModuleController.php b/typo3/sysext/recycler/Classes/Controller/RecyclerModuleController.php index a60914e29ece2a855112d4dee6bbd2de63ffe24e..edd952867a108b6f3dcd5a598fd6574cd59647f8 100644 --- a/typo3/sysext/recycler/Classes/Controller/RecyclerModuleController.php +++ b/typo3/sysext/recycler/Classes/Controller/RecyclerModuleController.php @@ -17,6 +17,7 @@ namespace TYPO3\CMS\Recycler\Controller; use TYPO3\CMS\Backend\Template\Components\ButtonBar; use TYPO3\CMS\Backend\View\BackendTemplateView; use TYPO3\CMS\Core\Imaging\Icon; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use TYPO3\CMS\Extbase\Mvc\View\ViewInterface; @@ -80,7 +81,7 @@ class RecyclerModuleController extends ActionController { $this->id = (int)GeneralUtility::_GP('id'); $backendUser = $this->getBackendUser(); - $this->perms_clause = $backendUser->getPagePermsClause(1); + $this->perms_clause = $backendUser->getPagePermsClause(Permission::PAGE_SHOW); $this->pageRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause); $this->isAccessibleForCurrentUser = $this->id && is_array($this->pageRecord) || !$this->id && $this->getBackendUser()->isAdmin(); diff --git a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php index 1e40da1a980e96ab324af9b51f6d7c39b1bb03e1..16781efa1d09c074196db3f37dea00c6a1fe6bec 100644 --- a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php +++ b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php @@ -25,6 +25,7 @@ use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction; use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; use TYPO3\CMS\Core\DataHandling\DataHandler; use TYPO3\CMS\Core\Imaging\Icon; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; @@ -131,7 +132,7 @@ class TypoScriptTemplateModuleController extends BaseScriptClass $this->id = (int)GeneralUtility::_GP('id'); $this->sObj = GeneralUtility::_GP('sObj'); $this->edit = GeneralUtility::_GP('edit'); - $this->perms_clause = $this->getBackendUser()->getPagePermsClause(1); + $this->perms_clause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW); } /** diff --git a/typo3/sysext/viewpage/Classes/Controller/ViewModuleController.php b/typo3/sysext/viewpage/Classes/Controller/ViewModuleController.php index c11348ad91ebc367ca9a5341898d81bce75f5d81..76751ffd984b54481c3e24998c3f523698bb1405 100644 --- a/typo3/sysext/viewpage/Classes/Controller/ViewModuleController.php +++ b/typo3/sysext/viewpage/Classes/Controller/ViewModuleController.php @@ -23,6 +23,7 @@ use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Page\PageRenderer; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use TYPO3\CMS\Extbase\Mvc\View\ViewInterface; @@ -167,7 +168,7 @@ class ViewModuleController extends ActionController { $pageIdToShow = (int)GeneralUtility::_GP('id'); - $permissionClause = $this->getBackendUser()->getPagePermsClause(1); + $permissionClause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW); $pageRecord = BackendUtility::readPageAccess($pageIdToShow, $permissionClause); if ($pageRecord) { $this->view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation($pageRecord); @@ -212,7 +213,7 @@ class ViewModuleController extends ActionController protected function getAdminCommand($pageId) { // The page will show only if there is a valid page and if this page may be viewed by the user - $pageinfo = BackendUtility::readPageAccess($pageId, $this->getBackendUser()->getPagePermsClause(1)); + $pageinfo = BackendUtility::readPageAccess($pageId, $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW)); $addCommand = ''; if (is_array($pageinfo)) { $addCommand = '&ADMCMD_editIcons=1' . BackendUtility::ADMCMD_previewCmds($pageinfo); diff --git a/typo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php b/typo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php index e67ccaf7f2da452e5890ebd464fa4ec27070f5a5..57979b3719ddad4173072c8d55eea1f8da54fded 100644 --- a/typo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php +++ b/typo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php @@ -25,6 +25,7 @@ use TYPO3\CMS\Core\Database\ReferenceIndex; use TYPO3\CMS\Core\DataHandling\DataHandler; use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Service\MarkerBasedTemplateService; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Versioning\VersionState; @@ -1603,7 +1604,7 @@ class DataHandlerHook } if ($table === 'pages') { // Copy page access settings from original page to placeholder - $perms_clause = $dataHandler->BE_USER->getPagePermsClause(1); + $perms_clause = $dataHandler->BE_USER->getPagePermsClause(Permission::PAGE_SHOW); $access = BackendUtility::readPageAccess($uid, $perms_clause); $newVersion_placeholderFieldArray['perms_userid'] = $access['perms_userid']; $newVersion_placeholderFieldArray['perms_groupid'] = $access['perms_groupid']; diff --git a/typo3/sysext/workspaces/Classes/Service/WorkspaceService.php b/typo3/sysext/workspaces/Classes/Service/WorkspaceService.php index 17dcc1bc1f92cd3597afd7e6b39a18c15a8500fa..45f8a847ca12936d421ae882f236db161b7ab4e8 100644 --- a/typo3/sysext/workspaces/Classes/Service/WorkspaceService.php +++ b/typo3/sysext/workspaces/Classes/Service/WorkspaceService.php @@ -23,6 +23,7 @@ use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction; use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; use TYPO3\CMS\Core\Database\Query\Restriction\RootLevelRestriction; use TYPO3\CMS\Core\SingletonInterface; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Core\Versioning\VersionState; @@ -519,7 +520,7 @@ class WorkspaceService implements SingletonInterface { // Reusing existing functionality with the drawback that // mount points are not covered yet - $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); + $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(Permission::PAGE_SHOW); /** @var $searchObj \TYPO3\CMS\Core\Database\QueryView */ $searchObj = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\QueryView::class); if ($pageId > 0) {