[BUGFIX] Enable ProcessedFiles to do file exists 64/23664/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Fri, 6 Sep 2013 10:53:15 +0000 (12:53 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Mon, 9 Sep 2013 13:15:38 +0000 (15:15 +0200)
Make storage 0 folder readable, browsable and writable
to mitigate the problems that arise with non
readable processing directories.

Also allow file exists in general if the
identifier in subject is in processing folder.

Resolves: #51808
Releases: 6.0, 6.1, 6.2
Change-Id: I1959d7911d955592db1771d608e8fafcc26c45e9
Reviewed-on: https://review.typo3.org/23664
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/core/Classes/Resource/ResourceFactory.php
typo3/sysext/core/Classes/Resource/ResourceStorage.php
typo3/sysext/core/Classes/Resource/Security/StoragePermissionsAspect.php

index fa1fe61..54b6e0d 100644 (file)
@@ -139,9 +139,9 @@ class ResourceFactory implements \TYPO3\CMS\Core\SingletonInterface {
                                        // legacy code
                                        'configuration' => '',
                                        'is_online' => TRUE,
-                                       'is_browsable' => FALSE,
+                                       'is_browsable' => TRUE,
                                        'is_public' => TRUE,
-                                       'is_writable' => FALSE
+                                       'is_writable' => TRUE
                                );
                                $storageConfiguration = array(
                                        'basePath' => '/',
index b4cdae6..714c4b8 100644 (file)
@@ -1256,7 +1256,10 @@ class ResourceStorage {
         * @return boolean
         */
        public function hasFile($identifier) {
-               $this->assureFolderReadPermission();
+               // Allow if identifier is in processing folder
+               if (!$this->driver->isWithin($this->getProcessingFolder(), $identifier)) {
+                       $this->assureFolderReadPermission();
+               }
                return $this->driver->fileExists($identifier);
        }
 
index 2ea9e9f..88d3966 100644 (file)
@@ -55,6 +55,7 @@ class StoragePermissionsAspect {
         * @var array
         */
        protected $defaultStorageZeroPermissions = array(
+               'readFolder' => TRUE,
                'readFile' => TRUE
        );
 
@@ -78,7 +79,7 @@ class StoragePermissionsAspect {
                        if ($storage->getUid() > 0) {
                                $storage->setUserPermissions($this->backendUserAuthentication->getFilePermissionsForStorage($storage));
                        } else {
-                               $storage->setUserPermissions($this->defaultStorageZeroPermissions);
+                               $storage->setEvaluatePermissions(FALSE);
                        }
                        $this->addFileMountsToStorage($storage);
                }