‪TYPO3CMS  10.4
TYPO3\CMS\Core\DataHandling\PagePermissionAssembler Class Reference

Public Member Functions

 __construct (array $defaultPermissions=null)
 
array applyDefaults (array $fieldArray, int $pid, int $backendUserId, int $backendUserGroupId)
 

Protected Member Functions

array setTSconfigPermissions (array $fieldArray, array $tsconfig)
 
int assemblePermissions ($listOfPermissions)
 

Protected Attributes

array $defaultPermissions
 

Detailed Description

Class to determine and set proper permissions to a new (or copied) page.

The following order applies:

  • ‪defaultPermissions as defined in this class.
  • ‪TYPO3_CONF_VARS[BE][defaultPermissions]
  • ‪PageTSconfig va TCEMAIN.permissions

Definition at line 33 of file PagePermissionAssembler.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\DataHandling\PagePermissionAssembler::__construct ( array  $defaultPermissions = null)

Member Function Documentation

◆ applyDefaults()

array TYPO3\CMS\Core\DataHandling\PagePermissionAssembler::applyDefaults ( array  $fieldArray,
int  $pid,
int  $backendUserId,
int  $backendUserGroupId 
)

Set default permissions of a new page, and override via pageTSconfig.

Parameters
array$fieldArray‪the field array to be used
int$pid‪the parent page ID
int$backendUserId‪the owner of the page to be set
int$backendUserGroupId‪the owner group of the page to be set
Returns
‪array the enriched field array

Definition at line 69 of file PagePermissionAssembler.php.

References TYPO3\CMS\Core\DataHandling\PagePermissionAssembler\assemblePermissions(), TYPO3\CMS\Backend\Utility\BackendUtility\getPagesTSconfig(), and TYPO3\CMS\Core\DataHandling\PagePermissionAssembler\setTSconfigPermissions().

◆ assemblePermissions()

int TYPO3\CMS\Core\DataHandling\PagePermissionAssembler::assemblePermissions (   $listOfPermissions)
protected

Calculates the bitvalue of the permissions given in a string, comma-separated

Parameters
string$listOfPermissions‪a comma-separated list like "show,delete", usually from pageTSconfig
Returns
‪int Integer mask

Definition at line 117 of file PagePermissionAssembler.php.

References TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), TYPO3\CMS\Core\Type\Bitmask\Permission\getMap(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Core\DataHandling\PagePermissionAssembler\applyDefaults(), and TYPO3\CMS\Core\DataHandling\PagePermissionAssembler\setTSconfigPermissions().

◆ setTSconfigPermissions()

array TYPO3\CMS\Core\DataHandling\PagePermissionAssembler::setTSconfigPermissions ( array  $fieldArray,
array  $tsconfig 
)
protected

Setting up perms_* fields in $fieldArray based on TSconfig input Used for new pages and pages that are copied.

Parameters
array$fieldArray‪Field Array, returned with modifications
array$tsconfig‪TSconfig properties
Returns
‪array Modified Field Array

Definition at line 91 of file PagePermissionAssembler.php.

References TYPO3\CMS\Core\DataHandling\PagePermissionAssembler\assemblePermissions().

Referenced by TYPO3\CMS\Core\DataHandling\PagePermissionAssembler\applyDefaults().

Member Data Documentation

◆ $defaultPermissions

array TYPO3\CMS\Core\DataHandling\PagePermissionAssembler::$defaultPermissions
protected
Initial value:
= array(
'user' => 'show,edit,delete,new,editcontent',
'group' => 'show,edit,new,editcontent',
'everybody' => ''
)

Can be overridden from $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPermissions']

Definition at line 40 of file PagePermissionAssembler.php.

Referenced by TYPO3\CMS\Core\DataHandling\PagePermissionAssembler\__construct().