Bug #52056
closedRename folder action throws wrong exception on missing right
100%
Description
If a user does not have the rights to rename folders (i.e. permissions.file.defaultrenameFolder = 0
), method \TYPO3\CMS\Core\Resource\ResourceStorage::renameFolder() throws a "InsufficientFileAccessPermissionsException" whereas it should throw "InsufficientUserPermissionsException" instead.
This is consistent with similar user right check and is also the exception expected by \TYPO3\CMS\Core\Utility\File\ExtendedFileUtility::func_rename(), which will then display the error message saying "You are not allowed to rename directories".
The current situation leads to an uncaught exception. The correct solution is to change the exception as explained above, rather than add the currently thrown exception to the list of those being caught.
Updated by Francois Suter about 11 years ago
How to test:
- set up a user without rights to rename a folder
- switch to that user
- try to rename a folder and get an uncaught exception
- apply the patch
- rename a folder and get a proper error message.
Updated by Gerrit Code Review about 11 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23862
Updated by Gerrit Code Review about 11 years ago
Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/23925
Updated by Gerrit Code Review about 11 years ago
Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/23926
Updated by Francois Suter about 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset cb6bf25368567125120040af8b48c1424b5e3e8f.