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() : 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) : 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
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|nullisAllowedToShowEditForm()
Deny access to the edit form. This is not mandatory, but better to show this right away that access is denied.
public
isAllowedToShowEditForm(ModifyEditFormUserAccessEvent $event) : void
Parameters
- $event : ModifyEditFormUserAccessEvent
Attributes
- #[AsEventListener]
- 'evaluate-file-meta-data-edit-form-access'
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>