[BUGFIX] IRRE file upload button not shown to BE user 70/49870/2
authorFelix Rauch <rauch@skaiamail.de>
Mon, 5 Sep 2016 18:32:28 +0000 (20:32 +0200)
committerFrans Saris <franssaris@gmail.com>
Tue, 6 Sep 2016 06:35:47 +0000 (08:35 +0200)
If the logged in BE user does not have the "addFolder"
file operation permission, the button for uploading
files in IRRE forms is not shown. This commit fixes
this by checking for the "addFile" permission instead.

When fetching the default upload folder, TYPO3 already
checks whether the user is allowed to write to that
particular folder.

Releases: master,7.6
Resolves: #77841
Change-Id: Ic76d5fb36fd39b9fbcc554b9f03517c3cb1f301a
Reviewed-on: https://review.typo3.org/49870
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
typo3/sysext/backend/Classes/Form/Container/InlineControlContainer.php

index a37b68b..c7a0ff0 100644 (file)
@@ -479,7 +479,7 @@ class InlineControlContainer extends AbstractContainer
             );
             if (
                 $folder instanceof Folder
-                && $folder->checkActionPermission('add')
+                && $folder->getStorage()->checkUserActionPermission('add', 'File')
             ) {
                 $maxFileSize = GeneralUtility::getMaxUploadFileSize() * 1024;
                 $item .= ' <a href="#" class="btn btn-default t3js-drag-uploader inlineNewFileUploadButton ' . $this->inlineData['config'][$nameObject]['md5'] . '"