PagePermissionAssembler

class \TYPO3\CMS\Core\DataHandling\PagePermissionAssembler

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

Table of Contents

Properties

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

Methods

__construct()  : mixed
applyDefaults()  : array
Set default permissions of a new page, and override via pageTSconfig.
assemblePermissions()  : int
Calculates the bitvalue of the permissions given in a string, comma-separated
setTSconfigPermissions()  : array
Setting up perms_* fields in $fieldArray based on TSconfig input Used for new pages and pages that are copied.

Properties

$defaultPermissions

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

protected array $defaultPermissions = ['user' => 'show,edit,delete,new,editcontent', 'group' => 's…
Show the full value['user' => 'show,edit,delete,new,editcontent', 'group' => 'show,edit,new,editcontent', 'everybody' => '']

Methods

__construct()

public __construct([array|null $defaultPermissions = null ]) : mixed

Parameters

$defaultPermissions : array|null = null

applyDefaults()

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

public applyDefaults(array $fieldArray, int $pid, int $backendUserId, int $backendUserGroupId) : array

Parameters

$fieldArray : array

the field array to be used

$pid : int

the parent page ID

$backendUserId : int

the owner of the page to be set

$backendUserGroupId : int

the owner group of the page to be set

Return values

array —

the enriched field array

assemblePermissions()

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

protected assemblePermissions(string $listOfPermissions) : int

Parameters

$listOfPermissions : string

a comma-separated list like "show,delete", usually from pageTSconfig

Return values

int —

Integer mask

setTSconfigPermissions()

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

protected setTSconfigPermissions(array $fieldArray, array $tsconfig) : array

Parameters

$fieldArray : array

Field Array, returned with modifications

$tsconfig : array

TSconfig properties

Return values

array —

Modified Field Array

On this page