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]
  • Page TSconfig va TCEMAIN.permissions

Table of Contents

Properties

$defaultPermissions  : array<string|int, mixed>
Can be overridden from $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPermissions']

Methods

__construct()  : mixed
applyDefaults()  : array<string|int, mixed>
Set default permissions of a new page, and override via page TSconfig.
assemblePermissions()  : int
Calculates the bitvalue of the permissions given in a string, comma-separated
setTSconfigPermissions()  : array<string|int, mixed>
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<string|int, mixed> $defaultPermissions = ['user' => 'show,edit,delete,new,editcontent', 'group' => 'show,edit,new,editcontent', 'everybody' => '']

Methods

__construct()

public __construct([array<string|int, mixed>|null $defaultPermissions = null ]) : mixed
Parameters
$defaultPermissions : array<string|int, mixed>|null = null

applyDefaults()

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

public applyDefaults(array<string|int, mixed> $fieldArray, int $pid, int $backendUserId, int $backendUserGroupId) : array<string|int, mixed>
Parameters
$fieldArray : array<string|int, mixed>

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<string|int, mixed>

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 page TSconfig

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<string|int, mixed> $fieldArray, array<string|int, mixed> $tsconfig) : array<string|int, mixed>
Parameters
$fieldArray : array<string|int, mixed>

Field Array, returned with modifications

$tsconfig : array<string|int, mixed>

TSconfig properties

Return values
array<string|int, mixed>

Modified Field Array


        
On this page

Search results