Issue Task Closed

#77188Improve error-message for access to files outside of allowed filemounts

Stefan Neufeind 07/21/16, 09:22 updated 11/09/26, 12:19

Description

Requirements:
  • Have images in a file-storage somewhere
  • Create a text-with-image content and add that image
  • Edit that content with a user with limited rights
    • Make sure that user only has filemounts so that he/she can’t access the above added image
    • User should have access to sys_file_metadata and sys_file_reference
Situation:
  • Image is shown in the content-element
  • File-metadata can be overridden (sys_file_reference)
  • But clicking the edit-icon the original metadata for that file cannot be edited because the file is outside of allowed filemounts

Currently only a very generic error is shown:
“Access to table sys_file_metadata for user 2 was denied by a makeEditForm_accessCheck hook“
(which is an AccessDeniedHookException)

How specific could we be in this case? I assume we may not disclose the original path the user does not have access to. So maybe just some “That file is outside of the allowed filemounts for this user”?

Reviews 0

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

History 5

  1. Christian Toffolo commented <span data-processor="relativetime" data-value="2017-05-12T11:26:59+00:00" > 05/12/17, 11:26 </span>

    My editors encountered this bug in TYPO3 8 LTS too, please update TYPO3 Version to 8.

    The practical problem for the editors is that if they edit the content element with X modifications without saving, when they try to edit the sys_file_metadata they get the error and (if they don’t know the trick to navigate back in the browser) they loose all the X modifications.

    A flash alert should be the way to go.

  2. Anonymous commented and changed TYPO3 Version 8 10 <span data-processor="relativetime" data-value="2021-01-08T16:05:37+00:00" > 01/08/21, 16:05 </span>

    Just encountered this problem in TYPO3 10.4.11

  3. Benni Mack commented and changed status New Closed <span data-processor="relativetime" data-value="2026-11-09T12:19:49+00:00" > 11/09/26, 12:19 </span>

    Since #109293 (main, 14.3.8) the “Edit metadata” button of a file reference is only shown if the user may edit the metadata of that file (checkActionPermission(‘editMeta’), i.e. the file is within a writable file mount). Editors without access to the file therefore no longer end up on the generic access-denied error page and do not lose their unsaved changes.

    Closing as resolved by #109293. A more specific error message when opening such a metadata record directly would require a reason in ModifyEditFormUserAccessEvent::denyUserAccess() — please open a new feature request if this is still needed.