From abc68e63787e8df6199774882ce36c8da101f44b Mon Sep 17 00:00:00 2001 From: Legoktm Date: Thu, 12 May 2016 21:43:06 +0000 Subject: [PATCH] Revert "Split editcascadeprotected permission from protect permission" 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 | 2 -- includes/Title.php | 8 ++------ includes/user/User.php | 1 - languages/i18n/en.json | 3 +-- languages/i18n/qqq.json | 1 - tests/phpunit/includes/TitlePermissionTest.php | 2 +- 6 files changed, 4 insertions(+), 13 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 0bc8ad727d..5b3684b336 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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; diff --git a/includes/Title.php b/includes/Title.php index 9c9917aad4..7887890474 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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"; diff --git a/includes/user/User.php b/includes/user/User.php index d473e709f5..7c32c3b5a2 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -132,7 +132,6 @@ class User implements IDBAccessObject { 'deletelogentry', 'deleterevision', 'edit', - 'editcascadeprotected', 'editcontentmodel', 'editinterface', 'editprotected', diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 21088bd8cc..aacf623bdb 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -1193,8 +1193,7 @@ "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", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index cbcfbfd7d5..ddf544bce7 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -1372,7 +1372,6 @@ "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}}", diff --git a/tests/phpunit/includes/TitlePermissionTest.php b/tests/phpunit/includes/TitlePermissionTest.php index 18c6ee2219..5ecdf56134 100644 --- a/tests/phpunit/includes/TitlePermissionTest.php +++ b/tests/phpunit/includes/TitlePermissionTest.php @@ -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, -- 2.20.1