[CLEANUP] Use Permission constants consistently 56/55156/4
authorBenni Mack <benni@typo3.org>
Mon, 18 Dec 2017 20:27:38 +0000 (21:27 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Tue, 19 Dec 2017 09:51:42 +0000 (10:51 +0100)
Instead of integers, the permission constants
should be used throughout the TYPO3 Core.

Resolves: #83383
Releases: master
Change-Id: I00c10f97fc800d9533866c98284bbd22cd1bb575
Reviewed-on: https://review.typo3.org/55156
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
42 files changed:
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php
typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php
typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
typo3/sysext/backend/Classes/Controller/NewRecordController.php
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/Controller/Wizard/NewContentElementWizardController.php
typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php
typo3/sysext/backend/Classes/Form/Container/OuterWrapContainer.php
typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php
typo3/sysext/backend/Classes/Form/Wizard/SuggestWizardDefaultReceiver.php
typo3/sysext/backend/Classes/Module/BaseScriptClass.php
typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php
typo3/sysext/backend/Classes/Tree/View/BrowseTreeView.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/belog/Classes/Domain/Repository/LogEntryRepository.php
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php
typo3/sysext/core/Classes/Database/QueryGenerator.php
typo3/sysext/core/Classes/Database/QueryView.php
typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php
typo3/sysext/fluid/Classes/ViewHelpers/Be/PageInfoViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Be/PagePathViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Be/TableListViewHelper.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Classes/View/AdminPanelView.php
typo3/sysext/impexp/Classes/ImportExport.php
typo3/sysext/impexp/Classes/Task/ImportExportTask.php
typo3/sysext/impexp/Classes/View/ExportPageTreeView.php
typo3/sysext/indexed_search/Classes/Controller/AdministrationController.php
typo3/sysext/indexed_search/Classes/Domain/Repository/AdministrationRepository.php
typo3/sysext/info/Classes/Controller/TranslationStatusController.php
typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php
typo3/sysext/recordlist/Classes/Browser/DatabaseBrowser.php
typo3/sysext/recordlist/Classes/RecordList.php
typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
typo3/sysext/recycler/Classes/Controller/RecyclerModuleController.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php
typo3/sysext/viewpage/Classes/Controller/ViewModuleController.php
typo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php
typo3/sysext/workspaces/Classes/Service/WorkspaceService.php

index 7078dc3..635e590 100644 (file)
@@ -430,7 +430,7 @@ class BackendController
         $editId = preg_replace('/[^[:alnum:]_]/', '', GeneralUtility::_GET('edit'));
         if ($editId) {
             // Looking up the page to edit, checking permissions:
         $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 {
             if (MathUtility::canBeInterpretedAsInteger($editId)) {
                 $editRecord = BackendUtility::getRecordWSOL('pages', $editId, '*', $where);
             } else {
index 0b354ad..8e52931 100644 (file)
@@ -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\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;
 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 ($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' => '',
                     $this->view->assign('fullHistoryUrl', $this->buildUrl([
                         'element' => 'pages:' . $parentPage['pid'],
                         'historyEntry' => '',
@@ -166,7 +167,7 @@ class ElementHistoryController
             $pageId = $record['pid'];
         }
 
             $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);
         }
         if (is_array($pageAccess)) {
             $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($pageAccess);
         }
index 0b1ca8c..2a40d2d 100644 (file)
@@ -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\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;
 
 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->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();
 
         $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         $this->moduleTemplate->getDocHeaderComponent()->disable();
 
index 6150475..c33c43d 100644 (file)
@@ -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\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;
 
 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->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);
     }
 
     /**
     }
 
     /**
index d128935..690a323 100644 (file)
@@ -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\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;
 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())
         // 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);
     }
         $this->pageInfo = BackendUtility::readPageAccess($this->id, $perms_clause);
         $this->access = is_array($this->pageInfo);
     }
index 0afe4c4..fa517c5 100644 (file)
@@ -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\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;
 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)
     {
         $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)) {
         // This will hide records from display - it has nothing to do with user rights!!
         if ($pidList = $beUser->getTSConfigVal('options.hideRecords.pages')) {
             if (!empty($pidList)) {
index e89a693..0fb0708 100644 (file)
@@ -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->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'] : '';
         // Get session data
         $sessionData = $this->getBackendUser()->getSessionData(RecordList::class);
         $this->search_field = !empty($sessionData['search_field']) ? $sessionData['search_field'] : '';
index 57555c6..2e7df14 100644 (file)
@@ -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\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;
 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())
         $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);
     }
         $this->pageInfo = BackendUtility::readPageAccess($this->id, $permissionsClause);
         $this->access = is_array($this->pageInfo);
     }
index 940eb7b..4c88ba7 100644 (file)
@@ -411,7 +411,7 @@ class InlineRecordContainer extends AbstractContainer
         $nameObject = $this->inlineStackProcessor->getCurrentStructureDomObjectIdPrefix($data['inlineFirstPid']);
         $nameObjectFt = $nameObject . '-' . $foreignTable;
         $nameObjectFtId = $nameObjectFt . '-' . $rec['uid'];
         $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) {
         // If the listed table is 'pages' we have to request the permission settings for each page:
         $localCalcPerms = false;
         if ($isPagesTable) {
index 44ef896..52a189e 100644 (file)
@@ -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\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;
 
 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) {
         $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);
         }
 
             $recordPath = BackendUtility::getRecordPath($this->data['effectivePid'], $permissionsClause, 15);
         }
 
index 8601df5..f961d5d 100644 (file)
@@ -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\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;
 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 {
                 )
             );
         } else {
-            $queryBuilder->andWhere($backendUser->getPagePermsClause(1));
+            $queryBuilder->andWhere($backendUser->getPagePermsClause(Permission::PAGE_SHOW));
             if ($foreignTableName !== 'pages') {
                 $queryBuilder
                     ->from('pages')
             if ($foreignTableName !== 'pages') {
                 $queryBuilder
                     ->from('pages')
index abe989d..77573df 100644 (file)
@@ -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\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\Core\Utility\GeneralUtility;
 
 /**
@@ -119,7 +120,7 @@ class SuggestWizardDefaultReceiver
         }
         if ($this->table === 'pages') {
             $this->queryBuilder->andWhere(
         }
         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'])) {
             );
         }
         if (isset($config['addWhere'])) {
@@ -322,13 +323,13 @@ class SuggestWizardDefaultReceiver
         $retValue = true;
         $table = $this->mmForeignTable ?: $this->table;
         if ($table === 'pages') {
         $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 {
                 $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;
             }
         }
                 $retValue = false;
             }
         }
index b5d900b..43b9449 100644 (file)
@@ -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\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;
 
 /**
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -198,7 +199,7 @@ class BaseScriptClass
         }
         $this->id = (int)GeneralUtility::_GP('id');
         $this->CMD = GeneralUtility::_GP('CMD');
         }
         $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();
     }
         $this->menuConfig();
         $this->handleExternalFunctionValue();
     }
index ed26630..54f8636 100644 (file)
@@ -82,7 +82,7 @@ class LiveSearch
      */
     public function __construct()
     {
      */
     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);
     }
 
         $this->queryParser = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Search\LiveSearch\QueryParser::class);
     }
 
index a629897..3fcce8d 100644 (file)
@@ -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\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Database\ConnectionPool;
+use TYPO3\CMS\Core\Type\Bitmask\Permission;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
 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:
             }
         }
         // 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) {
         $this->title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
         $this->MOUNTS = $this->getBackendUser()->returnWebmounts();
         if ($pidList) {
index a09d108..e7da3f0 100644 (file)
@@ -715,7 +715,7 @@ class PageLayoutView implements LoggerAwareInterface
                 ->from('pages')
                 ->where(
                     $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($id, \PDO::PARAM_INT)),
                 ->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();
                 )
                 ->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)),
             ->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'])) {
             );
 
         if (!empty($GLOBALS['TCA']['pages']['ctrl']['sortby'])) {
@@ -3000,7 +3000,7 @@ class PageLayoutView implements LoggerAwareInterface
         $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
             ->getQueryBuilderForTable('pages')
             ->expr();
         $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);
         // 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);
index 5aacb46..c9874bf 100644 (file)
@@ -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\Belog\Domain\Model\LogEntry;
 use TYPO3\CMS\Core\Database\ConnectionPool;
+use TYPO3\CMS\Core\Type\Bitmask\Permission;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
 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);
         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());
             $pageTree->makeHTML = 0;
             $pageTree->fieldArray = ['uid'];
             $pageTree->getTree($constraint->getPageId(), $constraint->getDepth());
index 3bfcedf..28102b7 100644 (file)
@@ -383,7 +383,7 @@ class BackendUserAuthentication extends AbstractUserAuthentication
             $id = (int)$checkRec['t3ver_oid'];
         }
         if (!$readPerms) {
             $id = (int)$checkRec['t3ver_oid'];
         }
         if (!$readPerms) {
-            $readPerms = $this->getPagePermsClause(1);
+            $readPerms = $this->getPagePermsClause(Permission::PAGE_SHOW);
         }
         if ($id > 0) {
             $wM = $this->returnWebmounts();
         }
         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(
                     ->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(
                         $queryBuilder->expr()->in(
                             'uid',
                             $queryBuilder->createNamedParameter(
index 876a80b..0c95838 100644 (file)
@@ -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\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;
 
 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();
                             ->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) {
                             $webMountPageTree = '';
                             $webMountPageTreePrefix = '';
                             foreach ($webMounts as $webMount) {
@@ -1615,7 +1616,7 @@ class QueryGenerator
 
         if (!$backendUserAuthentication->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts']) {
             $webMounts = $backendUserAuthentication->returnWebmounts();
 
         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) {
             $webMountPageTree = '';
             $webMountPageTreePrefix = '';
             foreach ($webMounts as $webMount) {
index 8acc21c..0b1742b 100644 (file)
@@ -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\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;
 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();
                             ->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) {
                             $webMountPageTree = '';
                             $webMountPageTreePrefix = '';
                             foreach ($webMounts as $webMount) {
index a440c8e..7782f9f 100644 (file)
@@ -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\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;
 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);
 
         $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);
         $queryGenerator = GeneralUtility::makeInstance(QueryGenerator::class);
         foreach ($storagePids as $startPid) {
             $pids = $queryGenerator->getTreeList($startPid, $recursionDepth, 0, $permsClause);
index 16941ea..7c9d906 100644 (file)
@@ -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\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;
 
 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');
     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);
         // Add icon with context menu, etc:
         /** @var IconFactory $iconFactory */
         $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
index a00c983..b32fddf 100644 (file)
@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
  */
 
 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;
 
 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');
     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'];
         // Is this a real page
         if ($pageRecord['uid']) {
             $title = $pageRecord['_thePathFull'];
index e213a58..8b36cf5 100644 (file)
@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Type\Bitmask\Permission;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
 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');
 
 
         $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;
         /** @var $dblist \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList */
         $dblist = GeneralUtility::makeInstance(\TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::class);
         $dblist->pageRow = $pageinfo;
index a34872b..1f2a60d 100644 (file)
@@ -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\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;
 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)
                             ),
                                 'uid',
                                 $queryBuilder->createNamedParameter($this->id, \PDO::PARAM_INT)
                             ),
-                            $this->getBackendUser()->getPagePermsClause(1)
+                            $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW)
                         )
                         ->execute()
                         ->fetch();
                         )
                         ->execute()
                         ->fetch();
index baaa599..33afc1a 100644 (file)
@@ -165,7 +165,7 @@ class AdminPanelView
                                 'clearCacheLevels'
                             ),
                             0,
                                 'clearCacheLevels'
                             ),
                             0,
-                            $beUser->getPagePermsClause(1)
+                            $beUser->getPagePermsClause(Permission::PAGE_SHOW)
                         ) . $theStartId
                     );
             }
                         ) . $theStartId
                     );
             }
@@ -480,7 +480,7 @@ class AdminPanelView
                ->from('pages')
                ->where(
                    $queryBuilder->expr()->eq('pages.uid', $queryBuilder->quoteIdentifier('fe_groups.pid')),
                ->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);
                )
                ->execute()
                ->fetchColumn(0);
@@ -490,7 +490,7 @@ class AdminPanelView
                     ->from('pages')
                     ->where(
                         $queryBuilder->expr()->eq('pages.uid', $queryBuilder->quoteIdentifier('fe_groups.pid')),
                     ->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();
                     )
                     ->orderBy('fe_groups.title')
                     ->execute();
index bff4008..f0c1e2b 100644 (file)
@@ -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\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;
 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])) {
     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];
             $this->cache_getRecordPath[$pid] = (string)BackendUtility::getRecordPath($pid, $clause, 20);
         }
         return $this->cache_getRecordPath[$pid];
index e524a73..568307c 100644 (file)
@@ -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\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;
 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'));
             // 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();
             $usernames = BackendUtility::getUserNames();
             // Create preset links:
             $presets = $this->getPresets();
index 8953596..4d9d073 100644 (file)
@@ -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\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 TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -84,7 +85,7 @@ class ExportPageTreeView extends BrowseTreeView
     public function ext_tree($pid, $clause = '')
     {
         // Initialize:
     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 = [];
         // Get stored tree structure:
         $this->stored = unserialize($this->BE_USER->uc['browseTrees']['browsePages'], ['allowed_classes' => false]);
         $treeArr = [];
index 9cbab0a..c1b922f 100644 (file)
@@ -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\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;
 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);
         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);
             $pageRecord = BackendUtility::readPageAccess($this->pageUid, $permissionClause);
             if ($pageRecord) {
                 $view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation($pageRecord);
index 1c1db69..98f2f22 100644 (file)
@@ -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\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;
 
 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);
         }
         /** @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>';
         $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>';
index c44e63c..e87684d 100644 (file)
@@ -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\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;
 
 /**
 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);
             $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();
             $tree->addField('l18n_cfg');
             // Creating top icon; the current page
             $HTML = $this->iconFactory->getIconForRecord('pages', $treeStartingRecord, Icon::SIZE_SMALL)->render();
index b0a8cb4..7b6cbdf 100644 (file)
@@ -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\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;
 
 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->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;
         }
         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->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']) {
                 $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,
             $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
             $this->modTS['checkhidden']
         );
         // Always add the current page, because we are just displaying the results
index ec5a969..2a6285c 100644 (file)
@@ -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\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;
 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 />';
         }
 
             $out .= '<br />';
         }
 
-        $permsClause = $backendUser->getPagePermsClause(1);
+        $permsClause = $backendUser->getPagePermsClause(Permission::PAGE_SHOW);
         $pageInfo = BackendUtility::readPageAccess($this->expandPage, $permsClause);
 
         /** @var ElementBrowserRecordList $dbList */
         $pageInfo = BackendUtility::readPageAccess($this->expandPage, $permsClause);
 
         /** @var ElementBrowserRecordList $dbList */
index feb487a..d2afff3 100644 (file)
@@ -215,7 +215,7 @@ class RecordList
     {
         $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
         $backendUser = $this->getBackendUserAuthentication();
     {
         $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'] : '';
         // Get session data
         $sessionData = $backendUser->getSessionData(__CLASS__);
         $this->search_field = !empty($sessionData['search_field']) ? $sessionData['search_field'] : '';
index 08980b8..da4b14a 100644 (file)
@@ -433,7 +433,7 @@ class AbstractDatabaseRecordList extends AbstractRecordList
         $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
             ->getQueryBuilderForTable('pages')
             ->expr();
         $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);
         // 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);
index 34ce004..ae03dfd 100644 (file)
@@ -2863,7 +2863,7 @@ class DatabaseRecordList
         $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
             ->getQueryBuilderForTable('pages')
             ->expr();
         $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);
         // 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);
index a60914e..edd9528 100644 (file)
@@ -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\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;
 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->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();
 
         $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();
 
index 1e40da1..16781ef 100644 (file)
@@ -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\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;
 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->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);
     }
 
     /**
     }
 
     /**
index c11348a..76751ff 100644 (file)
@@ -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\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;
 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');
 
     {
         $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);
         $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
     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);
         $addCommand = '';
         if (is_array($pageinfo)) {
             $addCommand = '&ADMCMD_editIcons=1' . BackendUtility::ADMCMD_previewCmds($pageinfo);
index e67ccaf..57979b3 100644 (file)
@@ -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\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;
 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
             }
             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'];
                 $access = BackendUtility::readPageAccess($uid, $perms_clause);
                 $newVersion_placeholderFieldArray['perms_userid'] = $access['perms_userid'];
                 $newVersion_placeholderFieldArray['perms_groupid'] = $access['perms_groupid'];
index 17dcc1b..45f8a84 100644 (file)
@@ -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\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;
 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
     {
         // 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) {
         /** @var $searchObj \TYPO3\CMS\Core\Database\QueryView */
         $searchObj = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\QueryView::class);
         if ($pageId > 0) {