-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Security ViewHelper: Subgroups of Backend User Group #1719
Comments
This should do it (tested in TYPO3 v8): - $currentBackendUser = $this->getCurrentBackendUser();
- $currentUserGroups = trim($currentBackendUser['usergroup'], ',');
- $userGroups = false === empty($currentUserGroups) ? explode(',', $currentUserGroups) : [];
+ $userGroups = array_keys(\TYPO3\CMS\Backend\Utility\BackendUtility::getListGroupNames()); |
That one was deprecated in v9: https://docs.typo3.org/c/typo3/cms-core/9.5/en-us/Changelog/9.0/Deprecation-81534-BackendUtilitygetListGroupNamesDeprecated.html But looking at the code imho that also doesn't take subgroups into account? |
No, don't use getGroupNames() because it returns all existing BE usergroups. - $currentUserGroups = trim($currentBackendUser['usergroup'], ',');
+ $currentUserGroups = trim($currentBackendUser['usergroup_cached_list'], ','); |
Still not fixed.
|
In the security ViewHelper (v:security.allow or v:security.deny) the subgroups of backend user groups aren't considered.
E.g. when using this ViewHelper in Fluid...
...the ViewHelper should not only check if the current backend user has group with uid 5 assigned, but also, if one of his assigned backend groups has the group with uid 5 as subgroup (or one of the subgroups has this group assigned).
There is a core function to get the BE groups and subgroups of a current user:
The text was updated successfully, but these errors were encountered: