#99079User tsconfig overridden by subgroups
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
-
Rémy DANIEL changed subject
User tsconfig: including the same file overridesUser tsconfig overridden by subgroups 11/14/22, 09:59 -
Riccardo De Contardi commented and changed status
NewNeeds Feedback 06/23/24, 15:50 -
Benni Mack commented and changed status
Needs FeedbackClosed 11/09/26, 17:08Thanks 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:
- 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(seeGroupResolver::fetchGroupsRecursive()). - Duplicates are then removed so that each group keeps its last position (see the comment in
BackendUserAuthentication::fetchGroupData()):Advanced editors, Default, Special. - 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 = 0from “Default” (pulled in by “Special”) overrides the= 1from “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.
- 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
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: