AfterBackendGroupListConstraintsAssembledFromDemandEvent 

New in version 14.0

The PSR-14 event \TYPO3\CMS\Backend\Controller\Event\AfterBackendGroupListConstraintsAssembledFromDemandEvent is dispatched when the backend user repository fetches a list of filtered backend groups (itself called when displaying the list of groups in the backend module). It makes it possible to modify query constraints based on currently active filtering.

Example 

EXT:my_extension/Classes/Backend/EventListener/MyEventListener.php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Backend\EventListener;

use TYPO3\CMS\Beuser\Event\AfterBackendGroupListConstraintsAssembledFromDemandEvent;
use TYPO3\CMS\Core\Attribute\AsEventListener;

final readonly class MyEventListener
{
    #[AsEventListener]
    public function __invoke(AfterBackendGroupListConstraintsAssembledFromDemandEvent $event): void
    {
        $event->constraints[] = $event->query->eq('workspace_perms', 1);
    }
}
Copied!

API 

class AfterBackendGroupListConstraintsAssembledFromDemandEvent
Fully qualified name
\TYPO3\CMS\Beuser\Event\AfterBackendGroupListConstraintsAssembledFromDemandEvent

Event that is dispatched after the backend user repository fetches a list of filtered backend users.

Listeners can modify query constraints based on currently active filtering.

param $demand

An instance of \TYPO3\CMS\Beuser\Domain\Dto\BackendUserGroup containing the current search criteria

param $query

The \TYPO3\CMS\Extbase\Persistence\QueryInterface instance being used to assemble the query

param $constraints

An array of query constraints. New constraints can be added to this array.