LFaraone has uploaded a new change for review.
https://gerrit.wikimedia.org/r/275268
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/68/275268/1
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: newchange
Gerrit-Change-Id: I2e194dae84a29c5ace254f55eda63cfe7f86c3ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: LFaraone <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits