$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;
$wgGrantPermissions['protect'] = $wgGrantPermissions['editprotected'];
$wgGrantPermissions['protect']['protect'] = true;
+$wgGrantPermissions['protect']['editcascadeprotected'] = true;
$wgGrantPermissions['viewmywatchlist']['viewmywatchlist'] = true;
}
if ( !$user->isAllowed( $right ) ) {
$errors[] = [ 'protectedpagetext', $right, $action ];
- } elseif ( $this->mCascadeRestriction && !$user->isAllowed( 'protect' ) ) {
+ } elseif ( $this->mCascadeRestriction &&
+ !$user->isAllowedAny( 'editcascadeprotected', 'protect' ) )
+ {
$errors[] = [ 'protectedpagetext', 'protect', $action ];
}
}
if ( $right == 'autoconfirmed' ) {
$right = 'editsemiprotected';
}
- if ( $right != '' && !$user->isAllowedAll( 'protect', $right ) ) {
+ if ( $right != '' && !$user->isAllowed( $right ) &&
+ !$user->isAllowedAny( 'editcascadeprotected', 'protect' ) )
+ {
$pages = '';
foreach ( $cascadingSources as $page ) {
$pages .= '* [[:' . $page->getPrefixedText() . "]]\n";
'deletelogentry',
'deleterevision',
'edit',
+ 'editcascadeprotected',
'editcontentmodel',
'editinterface',
'editprotected',
"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 and edit cascade-protected pages",
+ "right-protect": "Change protection levels",
+ "right-editcascadeprotected": "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",
"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}}",
Title::makeTitle( NS_MAIN, "UnBogus" )
];
$this->title->mCascadingRestrictions = [
- "bogus" => [ 'bogus', "sysop", "protect", "" ]
+ "bogus" => [ 'bogus', "sysop", "editcascadeprotected", "protect", "" ]
];
$this->assertEquals( false,