$uid = 123; if (\TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($uid)) { // User has access to page 123 } else { // User does not have access to page 123 }
$pages = \TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig(); $accessiblePages = []; foreach ($pages as $pageId => $config) { if (\TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($pageId)) { $accessiblePages[] = $pageId; } }
$uid = 123; $pid = 42; if (\TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($uid, $pid)) { // User with ID 42 has access to page 123 } else { // User with ID 42 does not have access to page 123 }These examples are part of the TYPO3 Core package library.