FileMetadataPermissionsAspect

readonly class \TYPO3\CMS\Core\Resource\Security\FileMetadataPermissionsAspect

Implements
DataHandlerCheckModifyAccessListHookInterface

Dealing with file metadata data security is an assembly of hooks to check permissions on files belonging to file metadata records

Attributes

#[Autoconfigure]
$public: true

Table of Contents

Interfaces

DataHandlerCheckModifyAccessListHookInterface
Interface for hook in \TYPO3\CMS\Core\DataHandling\DataHandler::checkModifyAccessList

Methods

__construct()  : mixed
checkModifyAccessList()  : void
Hook that determines whether a user has access to modify a table.
checkRecordUpdateAccess()  : int|null
This hook is called before any write operation by DataHandler
isAllowedToShowEditForm()  : void
Deny access to the edit form. This is not mandatory, but better to show this right away that access is denied.
checkFileWriteAccessForFileMetaData()  : bool
Checks write access to the file belonging to a metadata entry

Methods

checkModifyAccessList()

Hook that determines whether a user has access to modify a table.

public checkModifyAccessList(bool &$accessAllowed, string $table, DataHandler $parent) : void

We "abuse" it here to actually check if access is allowed to sys_file_metadata.

Parameters

$accessAllowed : bool

Whether the user has access to modify a table

$table : string

The name of the table to be modified

$parent : DataHandler

The calling parent object

checkRecordUpdateAccess()

This hook is called before any write operation by DataHandler

public checkRecordUpdateAccess(string $table, int $id, array $fileMetadataRecord, int|null $otherHookGrantedAccess, DataHandler $dataHandler) : int|null

Parameters

$table : string
$id : int
$fileMetadataRecord : array
$otherHookGrantedAccess : int|null
$dataHandler : DataHandler

Return values

int|null

checkFileWriteAccessForFileMetaData()

Checks write access to the file belonging to a metadata entry

protected checkFileWriteAccessForFileMetaData(array $fileMetadataRecord) : bool

Parameters

$fileMetadataRecord : array

Return values

bool
On this page