[BUGFIX] LocalDriver needs to respect "is_writeable" 01/17501/5
authorGeorg Ringer <georg.ringer@gmail.com>
Thu, 10 Jan 2013 09:37:21 +0000 (10:37 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Sat, 16 Feb 2013 18:00:28 +0000 (19:00 +0100)
The LocalDriver needs also to respect the flag "is_writeable".
This means: if the flag is not set, no folder/file can be edited/moved...

Fixes: #44370
Releases: 6.0,6.1

Change-Id: I404ed51c62ab96d9b5eaaf6c0b7b255bdea3538b
Reviewed-on: https://review.typo3.org/17501
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/core/Classes/Resource/ResourceStorage.php
typo3/sysext/core/Tests/Unit/Resource/ResourceStorageTest.php

index fbb66e9..3056084 100644 (file)
@@ -585,7 +585,7 @@ class ResourceStorage {
                        $isReadCheck = TRUE;
                }
                $isWriteCheck = FALSE;
-               if (in_array($action, array('write', 'delete'))) {
+               if (in_array($action, array('add', 'edit', 'write', 'upload', 'move', 'rename', 'unzip', 'remove'))) {
                        $isWriteCheck = TRUE;
                }
                // Check 3: Check the capabilities of the storage (and the driver)
@@ -631,7 +631,7 @@ class ResourceStorage {
                        $isReadCheck = TRUE;
                }
                $isWriteCheck = FALSE;
-               if (in_array($action, array('write', 'delete', 'deleteRecursive'))) {
+               if (in_array($action, array('add', 'move', 'write', 'remove', 'rename'))) {
                        $isWriteCheck = TRUE;
                }
                // Check 3: Check the capabilities of the storage (and the driver)
index d162790..9c41ea4 100644 (file)
@@ -67,7 +67,7 @@ class ResourceStorageTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCa
         * @return void
         */
        protected function prepareFixture($configuration, $mockPermissionChecks = FALSE, $driverObject = NULL, array $storageRecord = array()) {
-               $permissionMethods = array('isFileActionAllowed', 'isFolderActionAllowed', 'checkFileActionPermission', 'checkUserActionPermission');
+               $permissionMethods = array('checkFolderActionPermission', 'checkFileActionPermission', 'checkUserActionPermission');
                $mockedMethods = NULL;
                $configuration = $this->convertConfigurationArrayToFlexformXml($configuration);
                $storageRecord = \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule($storageRecord, array(