[BUGFIX] Correctly set user storage permissions 21/22921/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Wed, 7 Aug 2013 11:00:39 +0000 (13:00 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Wed, 7 Aug 2013 15:03:41 +0000 (17:03 +0200)
With FAL a new way to define file permissions
(for storages) has been introduced. You can set
these in User TsConfig instead of doing it
in the user record.

There is a backwards compatibility layer, which should
set the permissions according to the database entry
in case no permissions have been set in TsConfig.
This however does not work, because of a wrong check
for existence of UserTsConfig properties.

Instead of checking for an array (which is always the case),
we have to check if the array is not empty.

Releases: 6.0, 6.1, 6.2
Resolves: #50872
Change-Id: I0ec30a1ae96c4b6916a3e46c7222f832c44f603e
Reviewed-on: https://review.typo3.org/22921
Reviewed-by: Nicole Cordes
Tested-by: Nicole Cordes
Reviewed-by: Oliver Hader
Reviewed-by: Frans Saris
Tested-by: Frans Saris
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php

index e5bb199..70554c9 100644 (file)
@@ -1609,7 +1609,7 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
                        );
                        if (!$this->isAdmin()) {
                                $this->filePermissions = $this->getTSConfig('permissions.file.default');
-                               if (!is_array($this->filePermissions)) {
+                               if (empty($this->filePermissions)) {
                                        $oldFileOperationPermissions = $this->getFileoperationPermissions();
                                        // Lower permissions if the old file operation permissions are not set
                                        if ($oldFileOperationPermissions ^ 1) {