FileMetadataPermissionsAspect implements DataHandlerCheckModifyAccessListHookInterface, SingletonInterface

We do not have AOP in TYPO3 for now, thus the aspect which deals with file metadata data security is an assembly of hooks to check permissions on files belonging to file meta data records

Table of Contents

Interfaces

DataHandlerCheckModifyAccessListHookInterface
Interface for hook in \TYPO3\CMS\Core\DataHandling\DataHandler::checkModifyAccessList
SingletonInterface
"empty" interface for singletons (marker interface pattern)

Methods

checkModifyAccessList()  : mixed
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()  : bool
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) : mixed

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

Tags
throws
UnexpectedValueException

checkRecordUpdateAccess()

This hook is called before any write operation by DataHandler

public checkRecordUpdateAccess(string $table, int $id, array<string|int, mixed> $fileMetadataRecord, int|null $otherHookGrantedAccess, DataHandler $dataHandler) : int|null
Parameters
$table : string
$id : int
$fileMetadataRecord : array<string|int, mixed>
$otherHookGrantedAccess : int|null
$dataHandler : DataHandler
Return values
int|null

isAllowedToShowEditForm()

Deny access to the edit form. This is not mandatory, but better to show this right away that access is denied.

public isAllowedToShowEditForm(array<string|int, mixed> $parameters) : bool
Parameters
$parameters : array<string|int, mixed>
Return values
bool

checkFileWriteAccessForFileMetaData()

Checks write access to the file belonging to a metadata entry

protected checkFileWriteAccessForFileMetaData(array<string|int, mixed> $fileMetadataRecord) : bool
Parameters
$fileMetadataRecord : array<string|int, mixed>
Return values
bool

        
On this page

Search results