Project

General

Profile

Actions

Bug #64187

closed

RTE "modify link" throws exception if user doesn't have permissions to access filemount

Added by filigivuji filigivuji about 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

Using TYPO3 6.2.9. When a user presses "Modify link" in a RTE and the link points to a directory/filemount the user doesn't have permission to access, an exception is shown to the user and thus they cannot modify the link:

#1375955684: You are not allowed to access the given folder (More information)

TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException thrown in file
/var/www/typo3/docs/typo3_src-6.2.9/typo3/sysext/core/Classes/Resource/ResourceStorage.php in line 721.

6 TYPO3\CMS\Core\Resource\ResourceStorage::assureFolderReadPermission(TYPO3\CMS\Core\Resource\Folder)

/var/www/typo3/docs/typo3_src-6.2.9/typo3/sysext/core/Classes/Resource/ResourceStorage.php:
02054: 
02055:   try {
02056:    $this->assureFolderReadPermission($folder);
02057:   } catch (Exception\InsufficientFolderAccessPermissionsException $e) {
02058:    $folder = NULL;

5 TYPO3\CMS\Core\Resource\ResourceStorage::getFolder("/some/folder/")

/var/www/typo3/docs/typo3_src-6.2.9/typo3/sysext/core/Classes/Resource/AbstractFile.php:
00546:   */
00547:  public function getParentFolder() {
00548:   return $this->getStorage()->getFolder($this->getStorage()->getFolderIdentifierFromFileIdentifier($this->getIdentifier()));
00549:  }
00550: }

4 TYPO3\CMS\Core\Resource\AbstractFile::getParentFolder()

/var/www/typo3/docs/typo3_src-6.2.9/typo3/sysext/rtehtmlarea/Classes/BrowseLinks.php:
00559:      } elseif ($fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\FileInterface) {
00560:       // It's a file
00561:       $selectedFolder = $fileOrFolderObject->getParentFolder();
00562:      }
00563:     }

3 TYPO3\CMS\Rtehtmlarea\BrowseLinks::main_rte()

/var/www/typo3/docs/typo3_src-6.2.9/typo3/sysext/rtehtmlarea/Classes/Controller/BrowseLinksController.php:
00087:    list($modData, $store) = $GLOBALS['SOBE']->browser->processSessionData($modData);
00088:    $GLOBALS['BE_USER']->pushModuleData('browse_links.php', $modData);
00089:    $this->content = $GLOBALS['SOBE']->browser->main_rte();
00090:   }
00091:  }

2 TYPO3\CMS\Rtehtmlarea\Controller\BrowseLinksController::main()

/var/www/typo3/docs/typo3_src-6.2.9/typo3/sysext/rtehtmlarea/mod3/index.php:
00025: // Make instance:
00026: $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Rtehtmlarea\\Controller\\BrowseLinksController');
00027: $SOBE->main();
00028: $SOBE->printContent();

1 require("/var/www/typo3/docs/typo3_src-6.2.9/typo3/sysext/rtehtmlarea/mod3/index.php")

/var/www/typo3/docs/typo3_src-6.2.9/typo3/mod.php:
00030:  require $temp_path . 'conf.php';
00031:  $BACK_PATH = '';
00032:  require $temp_path . 'index.php';
00033:  $isDispatched = TRUE;
00034: } else {

The user should be able to change the link to a place they do have access to.

This is a regression from TYPO3 4.5.

Actions #1

Updated by Markus Klein about 9 years ago

  • Is Regression changed from Yes to No

Thanks for the report.
Can you please test, if this change works for you?

/var/www/typo3/docs/typo3_src-6.2.9/typo3/sysext/rtehtmlarea/Classes/BrowseLinks.php
Replace line line 561 with this code.

try {
    $selectedFolder = $fileOrFolderObject->getParentFolder();
} catch (\Exception $e) {
    // Accessing the parent folder failed for some reason. e.g. permissions    
}

Actions #2

Updated by filigivuji filigivuji about 9 years ago

Yes, this fixes it.

Actions #3

Updated by Markus Klein about 9 years ago

Wow, that was fast! Thanks

Actions #4

Updated by Markus Klein about 9 years ago

  • Status changed from New to Accepted
  • Assignee set to Markus Klein
  • Priority changed from -- undefined -- to Must have
  • Target version set to next-patchlevel
  • Complexity set to easy
Actions #5

Updated by Gerrit Code Review about 9 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35905

Actions #6

Updated by Gerrit Code Review about 9 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35944

Actions #7

Updated by Gerrit Code Review about 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35905

Actions #8

Updated by Gerrit Code Review about 9 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35946

Actions #9

Updated by Markus Klein about 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF