TYPO3 CMS  TYPO3_6-2
StoragePermissionsAspect.php
Go to the documentation of this file.
1 <?php
3 
21 
33 
38 
42  protected $defaultStorageZeroPermissions = array(
43  'readFolder' => TRUE,
44  'readFile' => TRUE
45  );
46 
47 
51  public function __construct($backendUserAuthentication = NULL) {
52  $this->backendUserAuthentication = $backendUserAuthentication ?: $GLOBALS['BE_USER'];
53  }
54 
62  public function addUserPermissionsToStorage(ResourceFactory $resourceFactory, ResourceStorage $storage) {
63  if (!$this->backendUserAuthentication->isAdmin()) {
64  $storage->setEvaluatePermissions(TRUE);
65  if ($storage->getUid() > 0) {
66  $storage->setUserPermissions($this->backendUserAuthentication->getFilePermissionsForStorage($storage));
67  } else {
68  $storage->setEvaluatePermissions(FALSE);
69  }
70  $this->addFileMountsToStorage($storage);
71  }
72  }
73 
80  protected function addFileMountsToStorage(ResourceStorage $storage) {
81  foreach ($this->backendUserAuthentication->getFileMountRecords() as $fileMountRow) {
82  if ((int)$fileMountRow['base'] === (int)$storage->getUid()) {
83  try {
84  $storage->addFileMount($fileMountRow['path'], $fileMountRow);
85  } catch (FolderDoesNotExistException $e) {
86  // That file mount does not seem to be valid, fail silently
87  }
88  }
89  }
90  }
91 }
addFileMount($folderIdentifier, $additionalData=array())
setUserPermissions(array $userPermissions)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
addUserPermissionsToStorage(ResourceFactory $resourceFactory, ResourceStorage $storage)