Attention
TYPO3 v12 has reached end-of-life as of April 30th 2026 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v12 here: TYPO3 ELTS.
ModifyEditFormUserAccessEvent
New in version 12.0
This event serves as a more powerful and flexible alternative for the removed
$GLOBALS
hook.
The PSR-14 event
\TYPO3\
provides the full database row of the record in question next to the
exception, which might have been set by the Core. Additionally, the event allows
to modify the user access decision in an object-oriented way, using
convenience methods.
In case any listener to the new event denies user access, while it was initially
allowed by Core, the
\TYPO3\
will be thrown.
Example
Registration of the event listener in the extension's Services.:
services:
# Place here the default dependency injection configuration
MyVendor\MyExtension\Backend\EventListener\MyEventListener:
tags:
- name: event.listener
identifier: 'my-extension/backend/modify-edit-form-user-access'
Read how to configure dependency injection in extensions.
The corresponding event listener class:
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\Backend\EventListener;
use TYPO3\CMS\Backend\Form\Event\ModifyEditFormUserAccessEvent;
final class MyEventListener
{
public function __invoke(ModifyEditFormUserAccessEvent $event): void
{
// Deny access for creating records of a custom table
if ($event->getTableName() === 'tx_myext_domain_model_mytable' && $event->getCommand() === 'new') {
$event->denyUserAccess();
}
}
}
API
- class ModifyEditFormUserAccessEvent
-
- Fully qualified name
-
\TYPO3\
CMS\ Backend\ Form\ Event\ Modify Edit Form User Access Event
Listeners to this Event will be able to modify the user access decision for using FormEngine to create or edit a record.