Merge "Revert "Split editcascadeprotected permission from protect permission""
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 12 May 2016 21:53:41 +0000 (21:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 12 May 2016 21:53:41 +0000 (21:53 +0000)
includes/DefaultSettings.php
includes/Title.php
includes/user/User.php
languages/i18n/en.json
languages/i18n/qqq.json
tests/phpunit/includes/TitlePermissionTest.php

index 3436597..4ae050b 100644 (file)
@@ -4882,7 +4882,6 @@ $wgGroupPermissions['sysop']['move-categorypages'] = true;
 $wgGroupPermissions['sysop']['patrol'] = true;
 $wgGroupPermissions['sysop']['autopatrol'] = true;
 $wgGroupPermissions['sysop']['protect'] = true;
-$wgGroupPermissions['sysop']['editcascadeprotected'] = true;
 $wgGroupPermissions['sysop']['editprotected'] = true;
 $wgGroupPermissions['sysop']['rollback'] = true;
 $wgGroupPermissions['sysop']['upload'] = true;
@@ -5480,7 +5479,6 @@ $wgGrantPermissions['delete']['undelete'] = true;
 
 $wgGrantPermissions['protect'] = $wgGrantPermissions['editprotected'];
 $wgGrantPermissions['protect']['protect'] = true;
-$wgGrantPermissions['protect']['editcascadeprotected'] = true;
 
 $wgGrantPermissions['viewmywatchlist']['viewmywatchlist'] = true;
 
index ef806a5..876afe6 100644 (file)
@@ -2122,9 +2122,7 @@ class Title implements LinkTarget {
                        }
                        if ( !$user->isAllowed( $right ) ) {
                                $errors[] = [ 'protectedpagetext', $right, $action ];
-                       } elseif ( $this->mCascadeRestriction &&
-                               !$user->isAllowedAny( 'editcascadeprotected', 'protect' ) )
-                       {
+                       } elseif ( $this->mCascadeRestriction && !$user->isAllowed( 'protect' ) ) {
                                $errors[] = [ 'protectedpagetext', 'protect', $action ];
                        }
                }
@@ -2165,9 +2163,7 @@ class Title implements LinkTarget {
                                        if ( $right == 'autoconfirmed' ) {
                                                $right = 'editsemiprotected';
                                        }
-                                       if ( $right != '' && !$user->isAllowed( $right ) &&
-                                               !$user->isAllowedAny( 'editcascadeprotected', 'protect' ) )
-                                       {
+                                       if ( $right != '' && !$user->isAllowedAll( 'protect', $right ) ) {
                                                $pages = '';
                                                foreach ( $cascadingSources as $page ) {
                                                        $pages .= '* [[:' . $page->getPrefixedText() . "]]\n";
index fb4168f..b1c270f 100644 (file)
@@ -133,7 +133,6 @@ class User implements IDBAccessObject {
                'deletelogentry',
                'deleterevision',
                'edit',
-               'editcascadeprotected',
                'editcontentmodel',
                'editinterface',
                'editprotected',
index ca60b20..6752eb3 100644 (file)
        "right-hideuser": "Block a username, hiding it from the public",
        "right-ipblock-exempt": "Bypass IP blocks, auto-blocks and range blocks",
        "right-unblockself": "Unblock oneself",
-       "right-protect": "Change protection levels",
-       "right-editcascadeprotected": "Edit cascade-protected pages",
+       "right-protect": "Change protection levels and edit cascade-protected pages",
        "right-editprotected": "Edit pages protected as \"{{int:protect-level-sysop}}\"",
        "right-editsemiprotected": "Edit pages protected as \"{{int:protect-level-autoconfirmed}}\"",
        "right-editcontentmodel": "Edit the content model of a page",
index 2b893bf..1910060 100644 (file)
        "right-ipblock-exempt": "{{doc-right|ipblock-exempt}}\nThis user automatically bypasses IP blocks, auto-blocks and range blocks - so I presume - but I am uncertain",
        "right-unblockself": "{{doc-right|unblockself}}",
        "right-protect": "{{doc-right|protect}}",
-       "right-editcascadeprotected": "{{doc-right|editcascadeprotected}}",
        "right-editprotected": "{{doc-right|editprotected}}\nRefers to {{msg-mw|Protect-level-sysop}}.\n\nSee also:\n* {{msg-mw|Right-editsemiprotected}}",
        "right-editsemiprotected": "{{doc-right|editsemiprotected}}\nRefers to {{msg-mw|Protect-level-autoconfirmed}}.\n\nSee also:\n* {{msg-mw|Right-editprotected}}",
        "right-editcontentmodel": "{{doc-right|editcontentmodel}}",
index 18c6ee2..5ecdf56 100644 (file)
@@ -633,7 +633,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                        Title::makeTitle( NS_MAIN, "UnBogus" )
                ];
                $this->title->mCascadingRestrictions = [
-                       "bogus" => [ 'bogus', "sysop", "editcascadeprotected", "protect", "" ]
+                       "bogus" => [ 'bogus', "sysop", "protect", "" ]
                ];
 
                $this->assertEquals( false,