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\ Raw Record \TYPO3\CMS\ Core\ Domain\ Page \TYPO3\CMS\ Core\ Domain\ Record\ Computed Properties \TYPO3\CMS\ Core\ Domain\ Record\ System Properties \TYPO3\CMS\ Core\ Domain\ Record\ Language Info \TYPO3\CMS\ Core\ Domain\ Record\ Version Info \TYPO3\, which creates these objectsCMS\ Core\ Domain\ Record Factory
These objects were already handed out by public API, for example by
\TYPO3\, by the
Before or
by the record- data processor in Fluid templates.
Page permission settings
The new method
\TYPO3\
returns the permission settings of a page as an immutable value object
\TYPO3\:
getandOwner User Id () getreturn the owning backend user and backend user group.Owner Group Id () get,Owner Permissions () getandGroup Permissions () getreturn aEverybody Permissions () Permissionobject 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.
get 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\.
$permissions = $page->getPermissions();
if ($permissions?->getEverybodyPermissions()->showPagePermissionIsGranted()) {
// ...
}
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.