[BUGFIX] Read permission check for folders is broken 05/19205/2
authorNicole Cordes <typo3@cordes.co>
Sat, 23 Mar 2013 09:31:15 +0000 (10:31 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Fri, 5 Apr 2013 20:01:06 +0000 (22:01 +0200)
The read permission check for folders is broken because there are some
inconsistencies in naming. For files the action to check is called "read",
for folders this check is called "browse". This should be adjusted for
folders to be equal to file check and renamed to "read".

Change-Id: I80862b60ea7d674df75dee0063764fed95570c6b
Fixes: #46582
Releases: 6.1, 6.0
Reviewed-on: https://review.typo3.org/19205
Reviewed-by: Alexander Opitz
Tested-by: Alexander Opitz
Reviewed-by: Tom Ruether
Reviewed-by: Stefan Neufeind
Reviewed-by: Wouter Wolters
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
t3lib/class.t3lib_userauthgroup.php
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php
typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php

index 1f501bb..f494ab2 100644 (file)
@@ -1414,7 +1414,7 @@ abstract class t3lib_userAuthGroup extends t3lib_userAuth {
         * removeFile = 1
         *
         * addFolder = 1
-        * browseFolder = 1
+        * readFolder = 1
         * moveFolder = 1
         * writeFolder = 1
         * renameFolder = 1
@@ -1452,7 +1452,7 @@ abstract class t3lib_userAuthGroup extends t3lib_userAuth {
                                'unzipFile' => TRUE,
                                'removeFile' => TRUE,
                                'addFolder' => TRUE,
-                               'browseFolder' => TRUE,
+                               'readFolder' => TRUE,
                                // new option,, generic check of the user rights
                                'moveFolder' => TRUE,
                                'renameFolder' => TRUE,
index 13b6230..a874bb4 100644 (file)
@@ -1557,7 +1557,7 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
         * removeFile = 1
         *
         * addFolder = 1
-        * browseFolder = 1
+        * readFolder = 1
         * moveFolder = 1
         * writeFolder = 1
         * renameFolder = 1
@@ -1595,7 +1595,7 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
                                'unzipFile' => TRUE,
                                'removeFile' => TRUE,
                                'addFolder' => TRUE,
-                               'browseFolder' => TRUE,
+                               'readFolder' => TRUE,
                                // new option,, generic check of the user rights
                                'moveFolder' => TRUE,
                                'renameFolder' => TRUE,
index 8874f50..e211efb 100644 (file)
@@ -1452,7 +1452,7 @@ class ElementBrowser {
         */
        public function TBE_expandSubFolders(\TYPO3\CMS\Core\Resource\Folder $folder) {
                $content = '';
-               if ($folder->checkActionPermission('browse')) {
+               if ($folder->checkActionPermission('read')) {
                        $content .= $this->folderList($folder);
                }
                // Return accumulated content for folderlisting:
@@ -1475,7 +1475,7 @@ class ElementBrowser {
        public function expandFolder(\TYPO3\CMS\Core\Resource\Folder $folder, $extensionList = '') {
                $out = '';
                $renderFolders = $this->act === 'folder';
-               if ($folder->checkActionPermission('browse')) {
+               if ($folder->checkActionPermission('read')) {
                        // Create header for filelisting:
                        $out .= $this->barheader($GLOBALS['LANG']->getLL('files') . ':');
                        // Prepare current path value for comparison (showing red arrow)
@@ -1544,7 +1544,7 @@ class ElementBrowser {
        public function TBE_expandFolder(\TYPO3\CMS\Core\Resource\Folder $folder, $extensionList = '', $noThumbs = 0) {
                $extensionList = $extensionList == '*' ? '' : $extensionList;
                $content = '';
-               if ($folder->checkActionPermission('browse')) {
+               if ($folder->checkActionPermission('read')) {
                        // Listing the files:
                        $files = $folder->getFiles($extensionList);
                        $content = $this->fileList($files, $folder, $noThumbs);