jenkins-bot has submitted this change and it was merged.

Change subject: Allow users with deleterevision but not deletedhistory to 
delete revisions
......................................................................


Allow users with deleterevision but not deletedhistory to delete revisions

Previously, Special:RevisionDelete required that the accessor had
deletedhistory to access it. Instead, we check for `deleterevision`, but
suppress output of the deletion log if the user lacks `deletedhistory`.

This has the side-effect of locking out users who have `deletedhistory` but not
`deleterevision` from accessing this special page, but that information is
available in other logs.

Bug: T128914
Change-Id: I2e194dae84a29c5ace254f55eda63cfe7f86c3ca
---
M includes/specials/SpecialRevisiondelete.php
1 file changed, 14 insertions(+), 12 deletions(-)

Approvals:
  Calak: Looks good to me, but someone else must approve
  Florianschmidtwelzow: Looks good to me, approved
  jenkins-bot: Verified
  Huji: Looks good to me, but someone else must approve



diff --git a/includes/specials/SpecialRevisiondelete.php 
b/includes/specials/SpecialRevisiondelete.php
index fcd4ab5..dcaff4d 100644
--- a/includes/specials/SpecialRevisiondelete.php
+++ b/includes/specials/SpecialRevisiondelete.php
@@ -106,7 +106,7 @@
        ];
 
        public function __construct() {
-               parent::__construct( 'Revisiondelete', 'deletedhistory' );
+               parent::__construct( 'Revisiondelete', 'deleterevision' );
        }
 
        public function doesWrites() {
@@ -210,17 +210,19 @@
                        $this->showForm();
                }
 
-               $qc = $this->getLogQueryCond();
-               # Show relevant lines from the deletion log
-               $deleteLogPage = new LogPage( 'delete' );
-               $output->addHTML( "<h2>" . $deleteLogPage->getName()->escaped() 
. "</h2>\n" );
-               LogEventsList::showLogExtract(
-                       $output,
-                       'delete',
-                       $this->targetObj,
-                       '', /* user */
-                       [ 'lim' => 25, 'conds' => $qc, 'useMaster' => 
$this->wasSaved ]
-               );
+               if ( $user->isAllowed( 'deletedhistory' ) ) {
+                       $qc = $this->getLogQueryCond();
+                       # Show relevant lines from the deletion log
+                       $deleteLogPage = new LogPage( 'delete' );
+                       $output->addHTML( "<h2>" . 
$deleteLogPage->getName()->escaped() . "</h2>\n" );
+                       LogEventsList::showLogExtract(
+                               $output,
+                               'delete',
+                               $this->targetObj,
+                               '', /* user */
+                               [ 'lim' => 25, 'conds' => $qc, 'useMaster' => 
$this->wasSaved ]
+                       );
+               }
                # Show relevant lines from the suppression log
                if ( $user->isAllowed( 'suppressionlog' ) ) {
                        $suppressLogPage = new LogPage( 'suppress' );

-- 
To view, visit https://gerrit.wikimedia.org/r/275268
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2e194dae84a29c5ace254f55eda63cfe7f86c3ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: LFaraone <l...@faraone.cc>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: CSteipp <cste...@wikimedia.org>
Gerrit-Reviewer: Calak <calakw...@yahoo.com>
Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Huji <huji.h...@gmail.com>
Gerrit-Reviewer: LFaraone <l...@faraone.cc>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Parent5446 <tylerro...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to