Unify the cache management permissions to `admin.management.canRebuildData`
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 4 May 2023 13:54:02 +0000 (15:54 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 4 May 2023 13:54:02 +0000 (15:54 +0200)
Previously CacheListPage and CacheClearAction used differing permissions, which
is not useful at all. Especially since the template didn't check the differing
permissions.

Unify them to “can rebuild data”, because it's the most related one, clearing
the cache effectively rebuilds some data.

com.woltlab.wcf/acpMenu.xml
wcfsetup/install/files/lib/acp/action/CacheClearAction.class.php
wcfsetup/install/files/lib/acp/page/CacheListPage.class.php

index 1b87f4feed4fcec3157d6dfa3a4aae485832cd18..5f839deffe78b182eb6ae0e65caa85d867763524 100644 (file)
                <acpmenuitem name="wcf.acp.menu.link.maintenance.cache">
                        <controller>wcf\acp\page\CacheListPage</controller>
                        <parent>wcf.acp.menu.link.maintenance</parent>
-                       <permissions>admin.configuration.canManageApplication</permissions>
+                       <permissions>admin.management.canRebuildData</permissions>
                </acpmenuitem>
                <acpmenuitem name="wcf.acp.menu.link.maintenance.rebuildData">
                        <controller>wcf\acp\page\RebuildDataPage</controller>
index 4d0ac2b62c93d03d57b6e500ddfd594207a4ba4b..1ec9ed8a0b0d51055bc4f9e40a47d503fd059ffc 100644 (file)
@@ -21,7 +21,7 @@ final class CacheClearAction extends AbstractSecureAction
     /**
      * @inheritDoc
      */
-    public $neededPermissions = ['admin.management.canViewLog'];
+    public $neededPermissions = ['admin.management.canRebuildData'];
 
     /**
      * @inheritDoc
index 4dada7d01ed38edc190f82826e92e21938f1ddf1..dfb94708015310e292411d16c63e1be7affd16bd 100755 (executable)
@@ -27,7 +27,7 @@ class CacheListPage extends AbstractPage
     /**
      * @inheritDoc
      */
-    public $neededPermissions = ['admin.configuration.canManageApplication'];
+    public $neededPermissions = ['admin.management.canRebuildData'];
 
     /**
      * indicates if cache was cleared