(bug 37926) Split 'deleterevision' right for log entries
authorAlex Monk <krenair@gmail.com>
Mon, 25 Jun 2012 16:07:51 +0000 (17:07 +0100)
committerAlex Monk <krenair@gmail.com>
Sat, 21 Jul 2012 19:34:23 +0000 (20:34 +0100)
This change adds a new permission ('deletelogentry') which is required to be able
to delete log entries.

It does not affect who can see deleted content.

Change-Id: I6b69919a1bdc502becc1ae4ac9169b8b0e85bfdc

RELEASE-NOTES-1.20
includes/DefaultSettings.php
includes/User.php
includes/logging/LogEventsList.php
includes/specials/SpecialLog.php
includes/specials/SpecialRevisiondelete.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

index 1c15cf0..2f463a7 100644 (file)
@@ -97,6 +97,8 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 36783) Implement jQuery Promise interface in mediawiki.api module.
 * Make dates in sortable tables sort according to the page content language
   instead of the site content language
+* (bug 37926) Deleterevision will no longer allow users to delete log entries,
+  the new deletelogentry permission is required for this.
 
 === Bug fixes in 1.20 ===
 * (bug 30245) Use the correct way to construct a log page title.
index 690d39e..3311fb1 100644 (file)
@@ -3781,6 +3781,7 @@ $wgGroupPermissions['bureaucrat']['noratelimit'] = true;
 // Permission to export pages including linked pages regardless of $wgExportMaxLinkDepth
 #$wgGroupPermissions['bureaucrat']['override-export-depth'] = true;
 
+#$wgGroupPermissions['sysop']['deletelogentry']  = true;
 #$wgGroupPermissions['sysop']['deleterevision']  = true;
 // To hide usernames from users and Sysops
 #$wgGroupPermissions['suppress']['hideuser'] = true;
index 51877f8..76e8420 100644 (file)
@@ -119,6 +119,7 @@ class User {
                'delete',
                'deletedhistory',
                'deletedtext',
+               'deletelogentry',
                'deleterevision',
                'edit',
                'editinterface',
index 1244dd3..d13591c 100644 (file)
@@ -493,9 +493,9 @@ class LogEventsList extends ContextSource {
                }
                $del = '';
                $user = $this->getUser();
-               // Don't show useless checkbox to people who cannot hide revisions
+               // Don't show useless checkbox to people who cannot hide log entries
                if( $user->isAllowed( 'deletedhistory' ) ) {
-                       if( $row->log_deleted || $user->isAllowed( 'deleterevision' ) ) {
+                       if( $row->log_deleted || $user->isAllowed( 'deletelogentry' ) ) {
                                $canHide = $user->isAllowed( 'deleterevision' );
                                if ( $this->flags & self::USE_REVDEL_CHECKBOXES ) { // Show checkboxes instead of links.
                                        if ( !self::userCan( $row, LogPage::DELETED_RESTRICTED, $user ) ) { // If event was hidden from sysops
index 2c96e83..8e4205c 100644 (file)
@@ -161,8 +161,8 @@ class SpecialLog extends SpecialPage {
        }
 
        private function getRevisionButton( $formcontents ) {
-               # If the user doesn't have the ability to delete revisions, don't bother showing him/her the button.
-               if ( !$this->getUser()->isAllowed( 'deleterevision' ) ) {
+               # If the user doesn't have the ability to delete log entries, don't bother showing him/her the button.
+               if ( !$this->getUser()->isAllowed( 'deletelogentry' ) ) {
                        return $formcontents;
                }
 
index fee870b..be432ac 100644 (file)
@@ -66,6 +66,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        'success'               => 'revdelete-success',
                        'failure'               => 'revdelete-failure',
                        'list-class'    => 'RevDel_RevisionList',
+                       'permission'    => 'deleterevision',
                ),
                'archive' => array(
                        'check-label'   => 'revdelete-hide-text',
@@ -73,6 +74,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        'success'               => 'revdelete-success',
                        'failure'               => 'revdelete-failure',
                        'list-class'    => 'RevDel_ArchiveList',
+                       'permission'    => 'deleterevision',
                ),
                'oldimage'=> array(
                        'check-label'   => 'revdelete-hide-image',
@@ -80,6 +82,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        'success'               => 'revdelete-success',
                        'failure'               => 'revdelete-failure',
                        'list-class'    => 'RevDel_FileList',
+                       'permission'    => 'deleterevision',
                ),
                'filearchive' => array(
                        'check-label'   => 'revdelete-hide-image',
@@ -87,6 +90,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        'success'               => 'revdelete-success',
                        'failure'               => 'revdelete-failure',
                        'list-class'    => 'RevDel_ArchivedFileList',
+                       'permission'    => 'deleterevision',
                ),
                'logging' => array(
                        'check-label'   => 'revdelete-hide-name',
@@ -94,6 +98,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        'success'               => 'logdelete-success',
                        'failure'               => 'logdelete-failure',
                        'list-class'    => 'RevDel_LogList',
+                       'permission'    => 'deletelogentry',
                ),
        );
 
@@ -117,7 +122,6 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                $output = $this->getOutput();
                $user = $this->getUser();
 
-               $this->mIsAllowed = $user->isAllowed('deleterevision'); // for changes
                $this->setHeaders();
                $this->outputHeader();
                $request = $this->getRequest();
@@ -163,6 +167,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        return;
                }
                $this->typeInfo = self::$allowedTypes[$this->typeName];
+               $this->mIsAllowed = $user->isAllowed( $this->typeInfo['permission'] );
 
                # If we have revisions, get the title from the first one
                # since they should all be from the same page. This allows
index 9578ed5..48ec9b9 100644 (file)
@@ -1985,6 +1985,7 @@ Your e-mail address is not revealed when other users contact you.',
 'right-writeapi'              => 'Use of the write API',
 'right-delete'                => 'Delete pages',
 'right-bigdelete'             => 'Delete pages with large histories',
+'right-deletelogentry'        => 'Delete and undelete specific log entries',
 'right-deleterevision'        => 'Delete and undelete specific revisions of pages',
 'right-deletedhistory'        => 'View deleted history entries, without their associated text',
 'right-deletedtext'           => 'View deleted text and changes between deleted revisions',
index ef9dff1..55fe778 100644 (file)
@@ -1655,6 +1655,15 @@ If someone with this right (bots by default) edits a user talk page and marks it
 'right-writeapi' => '{{doc-right|writeapi}}',
 'right-delete' => '{{doc-right|delete}}',
 'right-bigdelete' => '{{doc-right|bigdelete}}',
+'right-deletelogentry' => '{{doc-right|deletelogentry}}
+This user right is part of the [[mw:RevisionDelete|RevisionDelete]] feature.
+It can be given to the group {{msg|group-sysop|pl=yes}}, although this right is disabled by default.
+
+See also
+* {{msg|right-suppressionlog|pl=yes}}
+* {{msg|right-hideuser|pl=yes}}
+* {{msg|right-suppressrevision|pl=yes}}
+* {{msg|right-deleterevision|pl=yes}}',
 'right-deleterevision' => '{{doc-right|deleterevision}}
 This user right is part of the [[mw:RevisionDelete|RevisionDelete]] feature.
 It can be given to the group {{msg|group-sysop|pl=yes}}, although this right is disabled by default.
@@ -1662,7 +1671,8 @@ It can be given to the group {{msg|group-sysop|pl=yes}}, although this right is
 See also
 * {{msg|right-suppressionlog|pl=yes}}
 * {{msg|right-hideuser|pl=yes}}
-* {{msg|right-suppressrevision|pl=yes}}',
+* {{msg|right-suppressrevision|pl=yes}}
+* {{msg|right-deletelogentry|pl=yes}}',
 'right-deletedhistory' => '{{doc-right|deletedhistory}}',
 'right-deletedtext' => '{{doc-right|deletedtext}}',
 'right-browsearchive' => '{{doc-right|browsearchive}}',
@@ -1674,6 +1684,7 @@ It can be given to the group {{msg|group-suppress|pl=yes}}, although that group
 See also
 * {{msg|right-suppressionlog|pl=yes}}
 * {{msg|right-hideuser|pl=yes}}
+* {{msg|right-deletelogentry|pl=yes}}
 * {{msg|right-deleterevision|pl=yes}}',
 'right-suppressionlog' => '{{doc-right|suppressionlog}}
 This user right is part of the [[mw:RevisionDelete|RevisionDelete]] feature.
@@ -1682,6 +1693,7 @@ It can be given to the group {{msg|group-suppress|pl=yes}}, although that group
 See also
 * {{msg|right-suppressrevision|pl=yes}}
 * {{msg|right-hideuser|pl=yes}}
+* {{msg|right-deletelogentry|pl=yes}}
 * {{msg|right-deleterevision|pl=yes}}',
 'right-block' => '{{doc-right|block}}',
 'right-blockemail' => '{{doc-right|blockemail}}',
@@ -1692,6 +1704,7 @@ It can be given to the group {{msg|group-suppress|pl=yes}}, although that group
 See also
 * {{msg|right-suppressionlog|pl=yes}}
 * {{msg|right-suppressrevision|pl=yes}}
+* {{msg|right-deletelogentry|pl=yes}}
 * {{msg|right-deleterevision|pl=yes}}',
 'right-ipblock-exempt' => '{{doc-right|ipblock-exempt}}
 This user automatically bypasses IP blocks, auto-blocks and range blocks - so I presume - but I am uncertain',
index d15647e..126faaa 100644 (file)
@@ -1134,6 +1134,7 @@ $wgMessageStructure = array(
                'right-writeapi',
                'right-delete',
                'right-bigdelete',
+               'right-deletelogentry',
                'right-deleterevision',
                'right-deletedhistory',
                'right-deletedtext',