Revert "Split editcascadeprotected permission from protect permission"
authorLegoktm <legoktm.wikipedia@gmail.com>
Thu, 12 May 2016 21:43:06 +0000 (21:43 +0000)
committerLegoktm <legoktm.wikipedia@gmail.com>
Thu, 12 May 2016 21:43:06 +0000 (21:43 +0000)
This doesn't make sense because 'editcascadeprotected'
effectively gives you 'protect' rights.

Furthermore, no actual usecase was provided except for a testwiki.

This reverts commit da3464badaf9c067a4c3d98448ca72a8324e1e19.

Change-Id: I655c1af8f418369c9551db86f24fb6b66c25afdd

includes/DefaultSettings.php
includes/Title.php
includes/user/User.php
languages/i18n/en.json
languages/i18n/qqq.json
tests/phpunit/includes/TitlePermissionTest.php

index 0bc8ad7..5b3684b 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;
@@ -5479,7 +5478,6 @@ $wgGrantPermissions['delete']['undelete'] = true;
 
 $wgGrantPermissions['protect'] = $wgGrantPermissions['editprotected'];
 $wgGrantPermissions['protect']['protect'] = true;
-$wgGrantPermissions['protect']['editcascadeprotected'] = true;
 
 $wgGrantPermissions['viewmywatchlist']['viewmywatchlist'] = true;
 
index 9c9917a..7887890 100644 (file)
@@ -2156,9 +2156,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 ];
                        }
                }
@@ -2199,9 +2197,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 d473e70..7c32c3b 100644 (file)
@@ -132,7 +132,6 @@ class User implements IDBAccessObject {
                'deletelogentry',
                'deleterevision',
                'edit',
-               'editcascadeprotected',
                'editcontentmodel',
                'editinterface',
                'editprotected',
index 21088bd..aacf623 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 cbcfbfd..ddf544b 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,