Actions
Bug #100959
openFile storage 'fileadmin' as default storage must be allowed for editors to show other other filemounts in other file storages
Status:
New
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2023-06-05
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
12
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:
Description
I have a separate file storage for the editors. However, this is only displayed if default file storage fileadmin has also been enabled. Otherwise, the error message appears:
You are not allowed to access the given folder: "" | TYPO3\CMS\Core\ResourceException\InsufficientFolderAccessPermissionsException thrown in file /www/htdocs/xxxxxxx/my-domain.de/typo3_src-12.4.1/typo3/sysext/core/Classes/Resource/ResourceStorage.php in line 849. Requested URL: https://my-domain.de/typo3/wizard/record/browse?token=--AnonymizedToken--&mode=file&bparams=%7C%7C%7Cgif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai,svg%7Cdata-72-tt_address-1-image-sys_file_reference
Updated by Robert Hafenried 11 months ago
I would expect that fileadmin sharing is not necessary since editors are not supposed to work with this file storage.
Updated by Robert Hafenried 11 months ago
- Target version deleted (
Candidate for patchlevel)
Updated by Julian Wundrak 10 months ago
We have the same problem in our project. Currently we use this patch:
Index: Classes/ElementBrowser/AbstractResourceBrowser.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/Classes/ElementBrowser/AbstractResourceBrowser.php b/Classes/ElementBrowser/AbstractResourceBrowser.php
--- a/Classes/ElementBrowser/AbstractResourceBrowser.php
+++ b/Classes/ElementBrowser/AbstractResourceBrowser.php (date 1688372094488)
@@ -116,9 +116,31 @@
}
if (!$this->selectedFolder) {
- $this->selectedFolder = $resourceFactory->getDefaultStorage()?->getRootLevelFolder() ?? null;
+ $this->selectedFolder = $this->findAccessableRootLevelFolder();
}
}
+
+ private function findAccessableRootLevelFolder(): ?Folder
+ {
+ $storages = [];
+ $storageRepository = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\StorageRepository::class);
+ foreach ($storageRepository->findAll() as $storage) {
+ if ($storage->isDefault()) {
+ \array_unshift($storages, $storage);
+ } else {
+ $storages[] = $storage;
+ }
+ }
+
+ foreach ($storages as $storage) {
+ $rootFolder = $storage->getRootLevelFolder();
+ if ($rootFolder && $rootFolder->checkActionPermission('read')) {
+ return $rootFolder;
+ }
+ }
+
+ return null;
+ }
protected function getViewModeButton(): ButtonInterface
{
I'm sure, that this is not the correct way, but the issue is, that the default-Storage is not accessable for the user by permissions. This patch select the first available folder, if nothing is selected.
Actions