Project

General

Profile

Actions

Bug #104423

open

Refetch groups recursively following AfterGroupsResolvedEvent dispatching

Added by Soren Malling 9 days ago. Updated 3 days ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Authentication
Target version:
-
Start date:
2024-07-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In the "GroupResolver" method "resolveGroupsForUser", we only fetch groups recursively before the event "AfterGroupdResolvedEvent".

It has the consequence of any groups added afterwards, will not have any subgroups fetched.

$resolvedGroups = $this->fetchGroupsRecursive($originalGroupIds);
$event = $this->eventDispatcher->dispatch(new AfterGroupsResolvedEvent($sourceTable, $resolvedGroups, $originalGroupIds, $userRecord));

We could redo the fetching afterwards, to ensure all groups are loaded recursively

$resolvedGroups = $this->fetchGroupsRecursive($originalGroupIds);
$event = $this->eventDispatcher->dispatch(new AfterGroupsResolvedEvent($sourceTable, $resolvedGroups, $originalGroupIds, $userRecord));
$resolvedGroupsAfterEvent = $this->fetchGroupsRecursive(array_map(fn(array $group) => $group['uid'], $event->getGroups()));
Actions

Also available in: Atom PDF