Issue Bug Closed

#75332Saving relations to files in sys_file_metadata does not work for normal users

Anonymous 03/31/16, 11:37 updated 02/04/18, 23:22

Description

TYPO3 6.2.19

I have extended the sys_file_metadata table with a field which is a file relation.
When I am logged in as admin user everything works fine, I can create relations to other files and store them.
When I am logged in as a normal, nonadmin user (with all possible access rights), I get an “Access Denied” alert and can not save the relation.

Here a minimal setup:

myext/Configuration/Overrides/sys_file_reference.php

<?php
if (!defined('TYPO3_MODE')) die ('Access denied.');

$tca = array(
    'ctrl' => array(
        'rootLevel' => -1, // Otherwise File Reference will not work between files.
    ),
);

// Disable the File Upload in IRRE since it can not be configured the target storage.
$GLOBALS['TCA']['sys_file_reference']['columns']['uid_local']['config']['appearance']['fileUploadAllowed'] = FALSE;

\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA']['sys_file_reference'], $tca);

myext/Configuration/Overrides/sys_file_metadata.php

<?php
if (!defined('TYPO3_MODE')) die ('Access denied.');

if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('filemetadata')) {
    $configuration = '--div--;LLL:EXT:hszg_documents/Resources/Private/Language/locallang.xlf:tab.documents, files';
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('sys_file_metadata', $configuration);
}

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.