[BUGFIX] Clear cache system icon is shown for non admin in dev context 24/46324/2
authorEric Chavaillaz <eric@hemmer.ch>
Wed, 27 Jan 2016 12:54:22 +0000 (13:54 +0100)
committerBenni Mack <benni@typo3.org>
Fri, 29 Jan 2016 08:55:53 +0000 (09:55 +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/46324
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/backend/Classes/Backend/ToolbarItems/ClearCacheToolbarItem.php

index 6cd57ec..c0d9c91 100644 (file)
@@ -81,10 +81,13 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
 
         // 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 admins)
         // or if $GLOBALS['TYPO3_CONF_VARS']['SYS']['clearCacheSystem'] is set (only for admins)
-        if ($backendUser->getTSConfigVal('options.clearCache.system') || GeneralUtility::getApplicationContext()->isDevelopment()
-            || ((bool)$GLOBALS['TYPO3_CONF_VARS']['SYS']['clearCacheSystem'] === true && $backendUser->isAdmin())) {
+        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',
                 'title' => $languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushSystemCachesTitle', true),