‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Resource\Security\FilePermissionAspect Class Reference
Inheritance diagram for TYPO3\CMS\Core\Resource\Security\FilePermissionAspect:
TYPO3\CMS\Core\DataHandling\DataHandlerCheckModifyAccessListHookInterface

Public Member Functions

 __construct (ResourceFactory $resourceFactory=null)
 
 checkModifyAccessList (&$accessAllowed, $table, DataHandler $parent)
 
 processDatamap_preProcessFieldArray (&$incomingFieldArray, string $table, $id, DataHandler $dataHandler)
 

Protected Member Functions

 logError (string $table, int $id, string $message, DataHandler $dataHandler)
 
 usesLegacyStorage (File $file)
 
bool usesDisallowedFileMount (File $file, string $fileAction, mixed $backendUser)
 
list<?FileresolveReferencedFiles (array $data, string $propertyName)
 
 resolveReferencedFile (array $data, string $propertyName)
 
 resolveFile (int $fileId)
 
 isValidStorageData (array $data)
 

Protected Attributes

ResourceFactory $resourceFactory
 

Detailed Description

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_file that 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

Definition at line 40 of file FilePermissionAspect.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Resource\Security\FilePermissionAspect::__construct ( ResourceFactory  $resourceFactory = null)

Member Function Documentation

◆ checkModifyAccessList()

TYPO3\CMS\Core\Resource\Security\FilePermissionAspect::checkModifyAccessList ( $accessAllowed,
  $table,
DataHandler  $parent 
)

Denies write access to sys_file in general, unless it is an internal process.

Parameters
bool&$accessAllowed
string$table
DataHandler$parent

Implements TYPO3\CMS\Core\DataHandling\DataHandlerCheckModifyAccessListHookInterface.

Definition at line 56 of file FilePermissionAspect.php.

◆ isValidStorageData()

TYPO3\CMS\Core\Resource\Security\FilePermissionAspect::isValidStorageData ( array  $data)
protected

◆ logError()

TYPO3\CMS\Core\Resource\Security\FilePermissionAspect::logError ( string  $table,
int  $id,
string  $message,
DataHandler  $dataHandler 
)
protected

◆ processDatamap_preProcessFieldArray()

TYPO3\CMS\Core\Resource\Security\FilePermissionAspect::processDatamap_preProcessFieldArray ( $incomingFieldArray,
string  $table,
  $id,
DataHandler  $dataHandler 
)

◆ resolveFile()

◆ resolveReferencedFile()

TYPO3\CMS\Core\Resource\Security\FilePermissionAspect::resolveReferencedFile ( array  $data,
string  $propertyName 
)
protected

◆ resolveReferencedFiles()

list<?File> TYPO3\CMS\Core\Resource\Security\FilePermissionAspect::resolveReferencedFiles ( array  $data,
string  $propertyName 
)
protected

◆ usesDisallowedFileMount()

bool TYPO3\CMS\Core\Resource\Security\FilePermissionAspect::usesDisallowedFileMount ( File  $file,
string  $fileAction,
mixed  $backendUser 
)
protected
Parameters
non-empty-string$fileAction
BackendUserAuthentication | mixed$backendUser
Returns
‪bool

Definition at line 142 of file FilePermissionAspect.php.

References TYPO3\CMS\Core\Resource\AbstractFile\getStorage(), and TYPO3\CMS\Core\Resource\AbstractFile\getUid().

Referenced by TYPO3\CMS\Core\Resource\Security\FilePermissionAspect\processDatamap_preProcessFieldArray().

◆ usesLegacyStorage()

TYPO3\CMS\Core\Resource\Security\FilePermissionAspect::usesLegacyStorage ( File  $file)
protected

Member Data Documentation

◆ $resourceFactory

ResourceFactory TYPO3\CMS\Core\Resource\Security\FilePermissionAspect::$resourceFactory
protected