$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 {
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;
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' => '',
$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);
}
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;
$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();
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;
$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);
}
/**
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;
// 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);
}
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;
{
$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->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'] : '';
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;
$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);
}
$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) {
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;
$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);
}
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;
)
);
} else {
- $queryBuilder->andWhere($backendUser->getPagePermsClause(1));
+ $queryBuilder->andWhere($backendUser->getPagePermsClause(Permission::PAGE_SHOW));
if ($foreignTableName !== 'pages') {
$queryBuilder
->from('pages')
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;
/**
}
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'])) {
$retValue = true;
$table = $this->mmForeignTable ?: $this->table;
if ($table === 'pages') {
- if (!BackendUtility::readPageAccess($uid, $GLOBALS['BE_USER']->getPagePermsClause(1))) {
+ if (!BackendUtility::readPageAccess($uid, $GLOBALS['BE_USER']->getPagePermsClause(Permission::PAGE_SHOW))) {
$retValue = false;
}
} elseif (isset($GLOBALS['TCA'][$table]['ctrl']['is_static']) && (bool)$GLOBALS['TCA'][$table]['ctrl']['is_static']) {
$retValue = true;
} else {
- if (!is_array(BackendUtility::readPageAccess($row['pid'], $GLOBALS['BE_USER']->getPagePermsClause(1)))) {
+ if (!is_array(BackendUtility::readPageAccess($row['pid'], $GLOBALS['BE_USER']->getPagePermsClause(Permission::PAGE_SHOW)))) {
$retValue = false;
}
}
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;
/**
}
$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();
}
*/
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);
}
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;
/**
}
}
// 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) {
->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();
->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'])) {
$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);
*/
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;
/**
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());
$id = (int)$checkRec['t3ver_oid'];
}
if (!$readPerms) {
- $readPerms = $this->getPagePermsClause(1);
+ $readPerms = $this->getPagePermsClause(Permission::PAGE_SHOW);
}
if ($id > 0) {
$wM = $this->returnWebmounts();
->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(
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;
->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) {
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) {
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;
->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) {
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;
$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);
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;
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);
*/
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;
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'];
*/
use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
$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;
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;
'uid',
$queryBuilder->createNamedParameter($this->id, \PDO::PARAM_INT)
),
- $this->getBackendUser()->getPagePermsClause(1)
+ $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW)
)
->execute()
->fetch();
'clearCacheLevels'
),
0,
- $beUser->getPagePermsClause(1)
+ $beUser->getPagePermsClause(Permission::PAGE_SHOW)
) . $theStartId
);
}
->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);
->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();
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;
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];
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;
// 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();
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;
/**
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 = [];
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;
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);
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;
}
/** @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>';
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;
/**
$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();
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;
$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;
}
$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']) {
$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
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;
$out .= '<br />';
}
- $permsClause = $backendUser->getPagePermsClause(1);
+ $permsClause = $backendUser->getPagePermsClause(Permission::PAGE_SHOW);
$pageInfo = BackendUtility::readPageAccess($this->expandPage, $permsClause);
/** @var ElementBrowserRecordList $dbList */
{
$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'] : '';
$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);
$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);
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;
{
$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();
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;
$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);
}
/**
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;
{
$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);
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);
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;
}
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'];
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;
{
// 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) {