Commit 7d09e999 authored by Benni Mack's avatar Benni Mack Committed by Georg Ringer
Browse files

[CLEANUP] Use Permission constants consistently

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: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Tymoteusz Motylewski's avatarTymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski's avatarTymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent 2cd01388
...@@ -18,6 +18,7 @@ use TYPO3\CMS\Core\Database\ConnectionPool; ...@@ -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\DeletedRestriction;
use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction; use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction;
use TYPO3\CMS\Core\Database\QueryGenerator; use TYPO3\CMS\Core\Database\QueryGenerator;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\TypoScript\TemplateService; use TYPO3\CMS\Core\TypoScript\TemplateService;
use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
...@@ -258,7 +259,7 @@ class BackendConfigurationManager extends AbstractConfigurationManager ...@@ -258,7 +259,7 @@ class BackendConfigurationManager extends AbstractConfigurationManager
$recursiveStoragePids = ''; $recursiveStoragePids = '';
$storagePids = GeneralUtility::intExplode(',', $storagePid); $storagePids = GeneralUtility::intExplode(',', $storagePid);
$permsClause = $this->getBackendUser()->getPagePermsClause(1); $permsClause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW);
$queryGenerator = GeneralUtility::makeInstance(QueryGenerator::class); $queryGenerator = GeneralUtility::makeInstance(QueryGenerator::class);
foreach ($storagePids as $startPid) { foreach ($storagePids as $startPid) {
$pids = $queryGenerator->getTreeList($startPid, $recursionDepth, 0, $permsClause); $pids = $queryGenerator->getTreeList($startPid, $recursionDepth, 0, $permsClause);
......
...@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be; ...@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be;
use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory; 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;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
...@@ -68,7 +69,7 @@ class PageInfoViewHelper extends AbstractBackendViewHelper ...@@ -68,7 +69,7 @@ class PageInfoViewHelper extends AbstractBackendViewHelper
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{ {
$id = GeneralUtility::_GP('id'); $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: // Add icon with context menu, etc:
/** @var IconFactory $iconFactory */ /** @var IconFactory $iconFactory */
$iconFactory = GeneralUtility::makeInstance(IconFactory::class); $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
......
...@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be; ...@@ -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;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
...@@ -66,7 +67,7 @@ class PagePathViewHelper extends AbstractBackendViewHelper ...@@ -66,7 +67,7 @@ class PagePathViewHelper extends AbstractBackendViewHelper
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{ {
$id = GeneralUtility::_GP('id'); $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 // Is this a real page
if ($pageRecord['uid']) { if ($pageRecord['uid']) {
$title = $pageRecord['_thePathFull']; $title = $pageRecord['_thePathFull'];
......
...@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be; ...@@ -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 ...@@ -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 */ /** @var $dblist \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList */
$dblist = GeneralUtility::makeInstance(\TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::class); $dblist = GeneralUtility::makeInstance(\TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::class);
$dblist->pageRow = $pageinfo; $dblist->pageRow = $pageinfo;
......
...@@ -40,6 +40,7 @@ use TYPO3\CMS\Core\Page\PageRenderer; ...@@ -40,6 +40,7 @@ use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Resource\StorageRepository; use TYPO3\CMS\Core\Resource\StorageRepository;
use TYPO3\CMS\Core\Service\DependencyOrderingService; use TYPO3\CMS\Core\Service\DependencyOrderingService;
use TYPO3\CMS\Core\TimeTracker\TimeTracker; 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\Parser\TypoScriptParser;
use TYPO3\CMS\Core\TypoScript\TemplateService; use TYPO3\CMS\Core\TypoScript\TemplateService;
use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\ArrayUtility;
...@@ -1626,7 +1627,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface ...@@ -1626,7 +1627,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
'uid', 'uid',
$queryBuilder->createNamedParameter($this->id, \PDO::PARAM_INT) $queryBuilder->createNamedParameter($this->id, \PDO::PARAM_INT)
), ),
$this->getBackendUser()->getPagePermsClause(1) $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW)
) )
->execute() ->execute()
->fetch(); ->fetch();
......
...@@ -165,7 +165,7 @@ class AdminPanelView ...@@ -165,7 +165,7 @@ class AdminPanelView
'clearCacheLevels' 'clearCacheLevels'
), ),
0, 0,
$beUser->getPagePermsClause(1) $beUser->getPagePermsClause(Permission::PAGE_SHOW)
) . $theStartId ) . $theStartId
); );
} }
...@@ -480,7 +480,7 @@ class AdminPanelView ...@@ -480,7 +480,7 @@ class AdminPanelView
->from('pages') ->from('pages')
->where( ->where(
$queryBuilder->expr()->eq('pages.uid', $queryBuilder->quoteIdentifier('fe_groups.pid')), $queryBuilder->expr()->eq('pages.uid', $queryBuilder->quoteIdentifier('fe_groups.pid')),
$this->getBackendUser()->getPagePermsClause(1) $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW)
) )
->execute() ->execute()
->fetchColumn(0); ->fetchColumn(0);
...@@ -490,7 +490,7 @@ class AdminPanelView ...@@ -490,7 +490,7 @@ class AdminPanelView
->from('pages') ->from('pages')
->where( ->where(
$queryBuilder->expr()->eq('pages.uid', $queryBuilder->quoteIdentifier('fe_groups.pid')), $queryBuilder->expr()->eq('pages.uid', $queryBuilder->quoteIdentifier('fe_groups.pid')),
$this->getBackendUser()->getPagePermsClause(1) $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW)
) )
->orderBy('fe_groups.title') ->orderBy('fe_groups.title')
->execute(); ->execute();
......
...@@ -21,6 +21,7 @@ use TYPO3\CMS\Core\Imaging\IconFactory; ...@@ -21,6 +21,7 @@ use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException; use TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException;
use TYPO3\CMS\Core\Resource\ResourceFactory; use TYPO3\CMS\Core\Resource\ResourceFactory;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Utility\DebugUtility; use TYPO3\CMS\Core\Utility\DebugUtility;
use TYPO3\CMS\Core\Utility\DiffUtility; use TYPO3\CMS\Core\Utility\DiffUtility;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
...@@ -1088,7 +1089,7 @@ abstract class ImportExport ...@@ -1088,7 +1089,7 @@ abstract class ImportExport
public function getRecordPath($pid) public function getRecordPath($pid)
{ {
if (!isset($this->cache_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); $this->cache_getRecordPath[$pid] = (string)BackendUtility::getRecordPath($pid, $clause, 20);
} }
return $this->cache_getRecordPath[$pid]; return $this->cache_getRecordPath[$pid];
......
...@@ -19,6 +19,7 @@ use TYPO3\CMS\Core\Database\ConnectionPool; ...@@ -19,6 +19,7 @@ use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\FlashMessageService; use TYPO3\CMS\Core\Messaging\FlashMessageService;
use TYPO3\CMS\Core\Resource\Exception; use TYPO3\CMS\Core\Resource\Exception;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Taskcenter\Controller\TaskModuleController; use TYPO3\CMS\Taskcenter\Controller\TaskModuleController;
use TYPO3\CMS\Taskcenter\TaskInterface; use TYPO3\CMS\Taskcenter\TaskInterface;
...@@ -104,7 +105,7 @@ class ImportExportTask implements TaskInterface ...@@ -104,7 +105,7 @@ class ImportExportTask implements TaskInterface
// Header // Header
$lang = $this->getLanguageService(); $lang = $this->getLanguageService();
$content .= $this->taskObject->description($lang->getLL('.alttitle'), $lang->getLL('.description')); $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(); $usernames = BackendUtility::getUserNames();
// Create preset links: // Create preset links:
$presets = $this->getPresets(); $presets = $this->getPresets();
......
...@@ -18,6 +18,7 @@ use TYPO3\CMS\Backend\Tree\View\BrowseTreeView; ...@@ -18,6 +18,7 @@ use TYPO3\CMS\Backend\Tree\View\BrowseTreeView;
use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory; 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 ...@@ -84,7 +85,7 @@ class ExportPageTreeView extends BrowseTreeView
public function ext_tree($pid, $clause = '') public function ext_tree($pid, $clause = '')
{ {
// Initialize: // 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: // Get stored tree structure:
$this->stored = unserialize($this->BE_USER->uc['browseTrees']['browsePages'], ['allowed_classes' => false]); $this->stored = unserialize($this->BE_USER->uc['browseTrees']['browsePages'], ['allowed_classes' => false]);
$treeArr = []; $treeArr = [];
......
...@@ -20,6 +20,7 @@ use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; ...@@ -20,6 +20,7 @@ use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Localization\LanguageService; 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;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Mvc\View\ViewInterface; use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
...@@ -89,7 +90,7 @@ class AdministrationController extends ActionController ...@@ -89,7 +90,7 @@ class AdministrationController extends ActionController
if ($view instanceof BackendTemplateView) { if ($view instanceof BackendTemplateView) {
/** @var BackendTemplateView $view */ /** @var BackendTemplateView $view */
parent::initializeView($view); parent::initializeView($view);
$permissionClause = $this->getBackendUserAuthentication()->getPagePermsClause(1); $permissionClause = $this->getBackendUserAuthentication()->getPagePermsClause(Permission::PAGE_SHOW);
$pageRecord = BackendUtility::readPageAccess($this->pageUid, $permissionClause); $pageRecord = BackendUtility::readPageAccess($this->pageUid, $permissionClause);
if ($pageRecord) { if ($pageRecord) {
$view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation($pageRecord); $view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation($pageRecord);
......
...@@ -25,6 +25,7 @@ use TYPO3\CMS\Core\Database\Query\QueryHelper; ...@@ -25,6 +25,7 @@ use TYPO3\CMS\Core\Database\Query\QueryHelper;
use TYPO3\CMS\Core\DataHandling\DataHandler; use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory; 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;
use TYPO3\CMS\IndexedSearch\FileContentParser; use TYPO3\CMS\IndexedSearch\FileContentParser;
...@@ -464,7 +465,7 @@ class AdministrationRepository ...@@ -464,7 +465,7 @@ class AdministrationRepository
} }
/** @var PageTreeView $tree */ /** @var PageTreeView $tree */
$tree = GeneralUtility::makeInstance(PageTreeView::class); $tree = GeneralUtility::makeInstance(PageTreeView::class);
$perms_clause = $this->getBackendUserAuthentication()->getPagePermsClause(1); $perms_clause = $this->getBackendUserAuthentication()->getPagePermsClause(Permission::PAGE_SHOW);
$tree->init('AND ' . $perms_clause); $tree->init('AND ' . $perms_clause);
$iconFactory = GeneralUtility::makeInstance(IconFactory::class); $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$HTML = '<span title="' . htmlspecialchars($pageRecord['title']) . '">' . $iconFactory->getIconForRecord('pages', $pageRecord, Icon::SIZE_SMALL)->render() . '</span>'; $HTML = '<span title="' . htmlspecialchars($pageRecord['title']) . '">' . $iconFactory->getIconForRecord('pages', $pageRecord, Icon::SIZE_SMALL)->render() . '</span>';
......
...@@ -22,6 +22,7 @@ use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction; ...@@ -22,6 +22,7 @@ use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction;
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory; 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 ...@@ -95,7 +96,7 @@ class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunc
$depth = $this->pObj->MOD_SETTINGS['depth']; $depth = $this->pObj->MOD_SETTINGS['depth'];
// Initialize tree object: // Initialize tree object:
$tree = GeneralUtility::makeInstance(PageTreeView::class); $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'); $tree->addField('l18n_cfg');
// Creating top icon; the current page // Creating top icon; the current page
$HTML = $this->iconFactory->getIconForRecord('pages', $treeStartingRecord, Icon::SIZE_SMALL)->render(); $HTML = $this->iconFactory->getIconForRecord('pages', $treeStartingRecord, Icon::SIZE_SMALL)->render();
......
...@@ -25,6 +25,7 @@ use TYPO3\CMS\Core\Imaging\IconFactory; ...@@ -25,6 +25,7 @@ use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\FlashMessageService; use TYPO3\CMS\Core\Messaging\FlashMessageService;
use TYPO3\CMS\Core\Service\MarkerBasedTemplateService; use TYPO3\CMS\Core\Service\MarkerBasedTemplateService;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Linkvalidator\LinkAnalyzer; use TYPO3\CMS\Linkvalidator\LinkAnalyzer;
...@@ -240,7 +241,7 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu ...@@ -240,7 +241,7 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
$this->doc = GeneralUtility::makeInstance(DocumentTemplate::class); $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
$this->doc->setModuleTemplate('EXT:linkvalidator/Resources/Private/Templates/mod_template.html'); $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()) { if ($this->pObj->id && is_array($this->pageRecord) || !$this->pObj->id && $this->isCurrentUserAdmin()) {
$this->isAccessibleForCurrentUser = true; $this->isAccessibleForCurrentUser = true;
} }
...@@ -279,7 +280,7 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu ...@@ -279,7 +280,7 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
$this->pObj->id, $this->pObj->id,
$this->searchLevel, $this->searchLevel,
0, 0,
$this->getBackendUser()->getPagePermsClause(1), $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW),
$this->modTS['checkhidden'] $this->modTS['checkhidden']
); );
if ($this->pObj->pageinfo['hidden'] == 0 || $this->modTS['checkhidden']) { if ($this->pObj->pageinfo['hidden'] == 0 || $this->modTS['checkhidden']) {
...@@ -431,7 +432,7 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu ...@@ -431,7 +432,7 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
$currentPageUid, $currentPageUid,
$this->searchLevel, $this->searchLevel,
0, 0,
$this->getBackendUser()->getPagePermsClause(1), $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW),
$this->modTS['checkhidden'] $this->modTS['checkhidden']
); );
// Always add the current page, because we are just displaying the results // Always add the current page, because we are just displaying the results
......
...@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Recordlist\Browser; ...@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Recordlist\Browser;
use TYPO3\CMS\Backend\RecordList\ElementBrowserRecordList; use TYPO3\CMS\Backend\RecordList\ElementBrowserRecordList;
use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Core\Utility\MathUtility;
use TYPO3\CMS\Recordlist\Tree\View\ElementBrowserPageTreeView; use TYPO3\CMS\Recordlist\Tree\View\ElementBrowserPageTreeView;
...@@ -230,7 +231,7 @@ class DatabaseBrowser extends AbstractElementBrowser implements ElementBrowserIn ...@@ -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); $pageInfo = BackendUtility::readPageAccess($this->expandPage, $permsClause);
/** @var ElementBrowserRecordList $dbList */ /** @var ElementBrowserRecordList $dbList */
......
...@@ -215,7 +215,7 @@ class RecordList ...@@ -215,7 +215,7 @@ class RecordList
{ {
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class); $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$backendUser = $this->getBackendUserAuthentication(); $backendUser = $this->getBackendUserAuthentication();
$this->perms_clause = $backendUser->getPagePermsClause(1); $this->perms_clause = $backendUser->getPagePermsClause(Permission::PAGE_SHOW);
// Get session data // Get session data
$sessionData = $backendUser->getSessionData(__CLASS__); $sessionData = $backendUser->getSessionData(__CLASS__);
$this->search_field = !empty($sessionData['search_field']) ? $sessionData['search_field'] : ''; $this->search_field = !empty($sessionData['search_field']) ? $sessionData['search_field'] : '';
......
...@@ -433,7 +433,7 @@ class AbstractDatabaseRecordList extends AbstractRecordList ...@@ -433,7 +433,7 @@ class AbstractDatabaseRecordList extends AbstractRecordList
$expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class) $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('pages') ->getQueryBuilderForTable('pages')
->expr(); ->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!! // This will hide records from display - it has nothing to do with user rights!!
if ($pidList = $backendUser->getTSConfigVal('options.hideRecords.pages')) { if ($pidList = $backendUser->getTSConfigVal('options.hideRecords.pages')) {
$pidList = GeneralUtility::intExplode(',', $pidList, true); $pidList = GeneralUtility::intExplode(',', $pidList, true);
......
...@@ -2863,7 +2863,7 @@ class DatabaseRecordList ...@@ -2863,7 +2863,7 @@ class DatabaseRecordList
$expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class) $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('pages') ->getQueryBuilderForTable('pages')
->expr(); ->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!! // This will hide records from display - it has nothing to do with user rights!!
if ($pidList = $backendUser->getTSConfigVal('options.hideRecords.pages')) { if ($pidList = $backendUser->getTSConfigVal('options.hideRecords.pages')) {
$pidList = GeneralUtility::intExplode(',', $pidList, true); $pidList = GeneralUtility::intExplode(',', $pidList, true);
......
...@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Recycler\Controller; ...@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Recycler\Controller;
use TYPO3\CMS\Backend\Template\Components\ButtonBar; use TYPO3\CMS\Backend\Template\Components\ButtonBar;
use TYPO3\CMS\Backend\View\BackendTemplateView; use TYPO3\CMS\Backend\View\BackendTemplateView;
use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Mvc\View\ViewInterface; use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
...@@ -80,7 +81,7 @@ class RecyclerModuleController extends ActionController ...@@ -80,7 +81,7 @@ class RecyclerModuleController extends ActionController
{ {
$this->id = (int)GeneralUtility::_GP('id'); $this->id = (int)GeneralUtility::_GP('id');
$backendUser = $this->getBackendUser(); $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->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->isAccessibleForCurrentUser = $this->id && is_array($this->pageRecord) || !$this->id && $this->getBackendUser()->isAdmin();
......
...@@ -25,6 +25,7 @@ use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction; ...@@ -25,6 +25,7 @@ use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction;
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
use TYPO3\CMS\Core\DataHandling\DataHandler; use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService; use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Core\Utility\MathUtility;
...@@ -131,7 +132,7 @@ class TypoScriptTemplateModuleController extends BaseScriptClass ...@@ -131,7 +132,7 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
$this->id = (int)GeneralUtility::_GP('id'); $this->id = (int)GeneralUtility::_GP('id');
$this->sObj = GeneralUtility::_GP('sObj'); $this->sObj = GeneralUtility::_GP('sObj');
$this->edit = GeneralUtility::_GP('edit'); $this->edit = GeneralUtility::_GP('edit');
$this->perms_clause = $this->getBackendUser()->getPagePermsClause(1); $this->perms_clause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW);
} }
/** /**
......
...@@ -23,6 +23,7 @@ use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction; ...@@ -23,6 +23,7 @@ use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction;
use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Page\PageRenderer; 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;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Mvc\View\ViewInterface; use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
...@@ -167,7 +168,7 @@ class ViewModuleController extends ActionController ...@@ -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); $pageRecord = BackendUtility::readPageAccess($pageIdToShow, $permissionClause);
if ($pageRecord) { if ($pageRecord) {
$this->view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation($pageRecord); $this->view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation($pageRecord);
...@@ -212,7 +213,7 @@ class ViewModuleController extends ActionController ...@@ -212,7 +213,7 @@ class ViewModuleController extends ActionController
protected function getAdminCommand($pageId) 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 // 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 = ''; $addCommand = '';
if (is_array($pageinfo)) { if (is_array($pageinfo)) {