aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPhy <git@phy25.com>2020-03-02 10:39:38 -0500
committerPhy <git@phy25.com>2020-03-02 21:39:16 -0500
commit2ae2e00140933a324fb8866bc7e215bb48e6f2b1 (patch)
treef1384db9a65d5b0b9f175ac85e8c4c0b2197012a
parent593051682619fec2ff67b505a2b4de21a78484e8 (diff)
downloaddokuwiki-2ae2e00140933a324fb8866bc7e215bb48e6f2b1.tar.gz
dokuwiki-2ae2e00140933a324fb8866bc7e215bb48e6f2b1.zip
relax Revert permission to EDIT from manager
Revert is another type of edit, which may be simulated by manual editing without using this shortcut. This patch thus relaxes the permission check. Thank you @Klap-in for pointing this out.
-rw-r--r--_test/tests/inc/Action/general.test.php2
-rw-r--r--inc/Action/Revert.php7
-rw-r--r--inc/Menu/Item/Revert.php2
3 files changed, 3 insertions, 8 deletions
diff --git a/_test/tests/inc/Action/general.test.php b/_test/tests/inc/Action/general.test.php
index aafeb4a83..4f05d0518 100644
--- a/_test/tests/inc/Action/general.test.php
+++ b/_test/tests/inc/Action/general.test.php
@@ -23,7 +23,7 @@ class action_general extends DokuWikiTest {
array('Resendpwd', AUTH_NONE, array('exists' => true, 'ismanager' => false)),
array('Backlink', AUTH_NONE, array('exists' => true, 'ismanager' => false)),
- array('Revert', AUTH_ADMIN, array('exists' => true, 'ismanager' => false)),
+ array('Revert', AUTH_EDIT, array('exists' => true, 'ismanager' => false)),
array('Revert', AUTH_EDIT, array('exists' => true, 'ismanager' => true)),
array('Admin', AUTH_READ, array('exists' => true, 'ismanager' => false)), // let in, check later again
diff --git a/inc/Action/Revert.php b/inc/Action/Revert.php
index ca35374f2..07c322cfe 100644
--- a/inc/Action/Revert.php
+++ b/inc/Action/Revert.php
@@ -16,12 +16,7 @@ class Revert extends AbstractAction {
/** @inheritdoc */
public function minimumPermission() {
- global $INFO;
- if($INFO['ismanager']) {
- return AUTH_EDIT;
- } else {
- return AUTH_ADMIN;
- }
+ return AUTH_EDIT;
}
/**
diff --git a/inc/Menu/Item/Revert.php b/inc/Menu/Item/Revert.php
index a360c6842..7d57df044 100644
--- a/inc/Menu/Item/Revert.php
+++ b/inc/Menu/Item/Revert.php
@@ -15,7 +15,7 @@ class Revert extends AbstractItem {
global $INFO;
parent::__construct();
- if(!$INFO['ismanager'] || !$REV || !$INFO['writable']) {
+ if(!$REV || !$INFO['writable']) {
throw new \RuntimeException('revert not available');
}
$this->params['rev'] = $REV;