FilePermissionAspect implements DataHandlerCheckModifyAccessListHookInterface
Read onlyYes
`DataHandler` hook handling to avoid direct access to `sys_file` related entities:
- denies any write access to sys_file(in datamap and cmdmap, unless it is an internal process)
- denies any write access to sys_filethat is on legacy storage
- denies any write access to sys_file_reference, referencing a file on legacy storage, or not part of the file-mounts of the corresponding user
- denies any write access to sys_file_metadata, referencing a file on legacy storage, or not part of the file-mounts of the corresponding user
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Interfaces
- DataHandlerCheckModifyAccessListHookInterface
- Interface for hook in \TYPO3\CMS\Core\DataHandling\DataHandler::checkModifyAccessList
Methods
- __construct() : mixed
- checkModifyAccessList() : void
- Denies write access to `sys_file` in general, unless it is an internal process.
- processDatamap_preProcessFieldArray() : void
- Checks file related data being processed in `DataHandler`: + `sys_file` (only if `checkModifyAccessList` passed -> during internal process) + `sys_file_reference` + `sys_file_metadata`
- isValidStorageData() : bool
- logError() : void
- resolveFile() : File|null
- resolveReferencedFile() : File|null
- resolveReferencedFiles() : array<int, File|null>
- usesDisallowedFileMount() : bool
- usesLegacyStorage() : bool
Methods
__construct()
    public
                    __construct(ResourceFactory $resourceFactory) : mixed
    Parameters
- $resourceFactory : ResourceFactory
checkModifyAccessList()
Denies write access to `sys_file` in general, unless it is an internal process.
    public
                    checkModifyAccessList(bool &$accessAllowed, string $table, DataHandler $parent) : void
    Parameters
- $accessAllowed : bool
- $table : string
- $parent : DataHandler
- 
                    The calling parent object 
processDatamap_preProcessFieldArray()
Checks file related data being processed in `DataHandler`: + `sys_file` (only if `checkModifyAccessList` passed -> during internal process) + `sys_file_reference` + `sys_file_metadata`
    public
                    processDatamap_preProcessFieldArray(mixed &$incomingFieldArray, string $table, int|string $id, DataHandler $dataHandler) : void
    Parameters
- $incomingFieldArray : mixed
- $table : string
- $id : int|string
- $dataHandler : DataHandler
isValidStorageData()
    protected
                    isValidStorageData(array<string|int, mixed> $data) : bool
    Parameters
- $data : array<string|int, mixed>
Return values
boollogError()
    protected
                    logError(string $table, int $id, string $message, DataHandler $dataHandler) : void
    Parameters
- $table : string
- $id : int
- $message : string
- $dataHandler : DataHandler
resolveFile()
    protected
                    resolveFile(int $fileId) : File|null
    Parameters
- $fileId : int
Return values
File|nullresolveReferencedFile()
    protected
                    resolveReferencedFile(array<string|int, mixed> $data, string $propertyName) : File|null
    Parameters
- $data : array<string|int, mixed>
- $propertyName : string
Return values
File|nullresolveReferencedFiles()
    protected
                    resolveReferencedFiles(array<string|int, mixed> $data, string $propertyName) : array<int, File|null>
    Parameters
- $data : array<string|int, mixed>
- $propertyName : string
Return values
array<int, File|null>usesDisallowedFileMount()
    protected
                    usesDisallowedFileMount(File $file, non-empty-string $fileAction, BackendUserAuthentication|mixed $backendUser) : bool
    Parameters
- $file : File
- $fileAction : non-empty-string
- $backendUser : BackendUserAuthentication|mixed
Return values
boolusesLegacyStorage()
    protected
                    usesLegacyStorage(File $file) : bool
    Parameters
- $file : File