[BUGFIX] Clear cache system icon is shown for non admin in dev context 25/46325/2
authorBenni Mack <benni@typo3.org>
Fri, 29 Jan 2016 08:57:49 +0000 (09:57 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 29 Jan 2016 09:19:39 +0000 (10:19 +0100)
If the context is in development mode, the clear cache system icon
is always shown in the toolbar, even if the user is not an admin.

Resolves: #72964
Releases: master, 7.6, 6.2
Change-Id: I674df49fee14ded4b2190cca098ddf146047e5f0
Reviewed-on: https://review.typo3.org/46325
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Toolbar/ClearCacheToolbarItem.php

index 17c4809..3384185 100644 (file)
@@ -86,9 +86,10 @@ class ClearCacheToolbarItem implements ToolbarItemHookInterface {
 
                // Clearing of system cache (core cache, class cache etc)
                // is only shown explicitly if activated for a BE-user (not activated for admins by default)
-               // or if the system runs in development mode
+               // or if the system runs in development mode (only for admin)
                // or if $GLOBALS['TYPO3_CONF_VARS']['SYS']['clearCacheSystem'] is set (only for admins)
-               if ($backendUser->getTSConfigVal('options.clearCache.system') || GeneralUtility::getApplicationContext()->isDevelopment()
+               if ($backendUser->getTSConfigVal('options.clearCache.system')
+                       || (GeneralUtility::getApplicationContext()->isDevelopment() && $backendUser->isAdmin())
                        || ((bool) $GLOBALS['TYPO3_CONF_VARS']['SYS']['clearCacheSystem'] === TRUE && $backendUser->isAdmin())) {
                        $this->cacheActions[] = array(
                                'id' => 'system',