Issue Bug Closed

#99079User tsconfig overridden by subgroups

Rémy DANIEL 11/14/22, 09:58 updated 11/09/26, 17:08

Description

Given the following TSconfig file:

# EXT:site/Configuration/TSconfig/user.tsconfig
options.clearCache.pages = 0

Given the following BE group setup:

  • Group Default
    tsconfig: <include_typoscript: source="FILE:EXT:site/Configuration/TSconfig/user.tsconfig"></include_typoscript:>
  • Group Special
    subgroups: Default
  • Group Advanced editors
    subgroups: Default
    tsconfig: options.clearCache.pages = 1

And given a user member of the groups “Advanced editors” and “Special”.

This user does not see the clearCache.pages button.

The reason is the order in the resolution of the subgroups, and the tsconfig parsing (see \TYPO3\CMS\Core\Authentication\BackendUserAuthentication::prepareUserTsConfig)
The resolved subgroups are : Default, Advanced editors, Default, Special
For each of this groups, the TSconfig is computed:

# TSCONFIG of group Default
# INCLUDE EXT:site/Configuration/TSconfig/user.tsconfig
options.clearCache.pages = 0

# TSCONFIG of group Advanced editors
options.clearCache.pages = 1

# TSCONFIG of group Default
# EXT:site/Configuration/TSconfig/user.tsconfig
options.clearCache.pages = 0

# TSCONFIG of group Special

At the end, the all TSconfig is parsed, and options.clearCache.pages will be 0.

A possible fix will be that the parser includes file only once.

My workaround was to remove the subgroup Default from the group Special.

Reviews 0

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

History 3

  1. Rémy DANIEL changed subject User tsconfig: including the same file overrides User tsconfig overridden by subgroups 11/14/22, 09:59

  2. Riccardo De Contardi commented and changed status New Needs Feedback 06/23/24, 15:50

    I am able to reproduce this issue on version 13;

    but I have been able to give the “editor” the Clear cache button just by acting on the order of the groups assigned to editor and making “Advanced editors” the LAST group:

    "Special"
    "Advanced editors"
  3. Benni Mack commented and changed status Needs Feedback Closed 11/09/26, 17:08

    Thanks for the detailed report, and sorry for the long silence.

    I checked this against the current main branch (v15). The behaviour is still the same, but it is the documented precedence of backend user groups rather than a defect:

    1. Groups are resolved recursively, and subgroups are always placed before the group that includes them. For a user with the groups “Advanced editors, Special”, this gives Default, Advanced editors, Default, Special (see GroupResolver::fetchGroupsRecursive()).
    2. Duplicates are then removed so that each group keeps its last position (see the comment in BackendUserAuthentication::fetchGroupData()): Advanced editors, Default, Special.
    3. User TSconfig is built from the groups in exactly this order, and each group is parsed only once. A later group overrides an earlier one, so options.clearCache.pages = 0 from “Default” (pulled in by “Special”) overrides the = 1 from “Advanced editors”.

    The suggested fix, to include the TSconfig only once, is effectively already in place: every group is parsed only once. Letting the first occurrence win instead would change which value wins for every installation that shares subgroups, which we cannot do as a bugfix.

    To control which group wins, change the order of the groups in the user record. As Riccardo noted, putting “Advanced editors” last gives the expected result. Alternatively, don’t add “Default” as a subgroup of both groups, or set the option in the user’s own TSconfig, which is always applied last.

    I’m closing this issue. If you think the precedence itself should change, please let me know and I will re-open the ticket.