Feature: #111301 - Declare Record API public and expose page permission settings 

See forge#111301

Description 

Record API 

The objects representing database records, introduced with TYPO3 v13, are now part of the public TYPO3 Core API:

  • \TYPO3\CMS\Core\Domain\Record
  • \TYPO3\CMS\Core\Domain\RawRecord
  • \TYPO3\CMS\Core\Domain\Page
  • \TYPO3\CMS\Core\Domain\Record\ComputedProperties
  • \TYPO3\CMS\Core\Domain\Record\SystemProperties
  • \TYPO3\CMS\Core\Domain\Record\LanguageInfo
  • \TYPO3\CMS\Core\Domain\Record\VersionInfo
  • \TYPO3\CMS\Core\Domain\RecordFactory , which creates these objects

These objects were already handed out by public API, for example by \TYPO3\CMS\Core\Domain\RecordInterface::getRawRecord() , by the BeforePageIsRetrievedEvent or by the record-transformation data processor in Fluid templates.

Page permission settings 

The new method \TYPO3\CMS\Core\Domain\Page::getPermissions() returns the permission settings of a page as an immutable value object \TYPO3\CMS\Core\Domain\Record\PagePermissions :

  • getOwnerUserId() and getOwnerGroupId() return the owning backend user and backend user group.
  • getOwnerPermissions() , getGroupPermissions() and getEverybodyPermissions() return a Permission object each.

The permission fields are not part of the TCA of the pages table, so they are not available as regular properties of a Page object. getPermissions() reads them from the raw database row and returns null if the page was retrieved without them.

The settings are the same for every backend user. Whether a specific backend user is granted a permission is still determined by \TYPO3\CMS\Core\Authentication\BackendUserAuthentication .

Check whether everybody may view a page
$permissions = $page->getPermissions();
if ($permissions?->getEverybodyPermissions()->showPagePermissionIsGranted()) {
    // ...
}
Copied!

Impact 

Extensions can type against the record objects and rely on them following the regular deprecation policy of the TYPO3 Core. The permission settings of a page are available in a typed way, without reading the perms_* fields of the database row.