[BUGFIX] Enable ProcessedFiles to do file exists 60/23660/6
authorHelmut Hummel <helmut.hummel@typo3.org>
Fri, 6 Sep 2013 10:53:15 +0000 (12:53 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 6 Sep 2013 17:43:21 +0000 (19:43 +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/23660
Reviewed-by: Horst-Dietrich Frank
Tested-by: Horst-Dietrich Frank
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Jakob Hombsch
Tested-by: Jakob Hombsch
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/core/Classes/Resource/ResourceFactory.php
typo3/sysext/core/Classes/Resource/ResourceStorage.php
typo3/sysext/core/Classes/Resource/Security/StoragePermissionsAspect.php

index c955681..6a5b8a0 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 0a8082b..f2fc82d 100644 (file)
@@ -1264,7 +1264,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);
                }