(bug 13137) Bots to edit protected pages
authorHuji <huji@users.mediawiki.org>
Wed, 19 Mar 2008 11:23:03 +0000 (11:23 +0000)
committerHuji <huji@users.mediawiki.org>
Wed, 19 Mar 2008 11:23:03 +0000 (11:23 +0000)
For the record: A previous effort to fix this (r31247) failed (r31462)

RELEASE-NOTES
includes/DefaultSettings.php
includes/Title.php

index ff9741d..63cfdd6 100644 (file)
@@ -115,18 +115,22 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Implemented {bl,ei,iu}redirect (lists links through redirects as well)
 * (bug 13154) Introduced subpages flag to meta=siteinfo&siprop=namespaces
 * (bug 13157) Added ucuserprefix parameter to list=usercontibs
-* (bug 12394) Added rctitles parameter to list=recentchanges, making rcid retrieval easier
+* (bug 12394) Added rctitles parameter to list=recentchanges, making rcid
+  retrieval easier
 * (bug 13218) Fix inclusion of " character in hyperlinks
 * Added watch and unwatch parameters to action=delete and action=move
 * Added action=edit
 * (bug 11401) Added xmldoublequote to xml formatter
-* Added rvsection parameter to prop=revisions to allow fetching the content of a certain section only
+* Added rvsection parameter to prop=revisions to allow fetching the content of
+  a certain section only
 * Introduced list=allimages
 * (bug 13371) Build page set from image hashes
 * Mark non-existent messages in meta=allmessages as missing
 * (bug 13390) One invalid title no longer kills an entire API query
 * (bug 13419) Fix gblredirect so it actually works
 * (bug 13418) Disable eiredirect because it's useless
+* (bug 13137) Allow setting 'editprotected' right separately from 'protect',    
+  so groups may optionally edit protected pages without having 'protect' perms
 
 === Languages updated in 1.13 ===
 
index e8d7ef9..6a8b156 100644 (file)
@@ -1132,7 +1132,6 @@ $wgGroupPermissions['sysop']['move']            = true;
 $wgGroupPermissions['sysop']['patrol']          = true;
 $wgGroupPermissions['sysop']['autopatrol']      = true;
 $wgGroupPermissions['sysop']['protect']         = true;
-$wgGroupPermissions['sysop']['editprotected']   = true;
 $wgGroupPermissions['sysop']['proxyunbannable'] = true;
 $wgGroupPermissions['sysop']['rollback']        = true;
 $wgGroupPermissions['sysop']['trackback']       = true;
index c65ce10..8191b2a 100644 (file)
@@ -1193,7 +1193,18 @@ class Title {
                                $right = 'protect';
                        }
                        if( '' != $right && !$user->isAllowed( $right ) ) {
-                               $errors[] = array( 'protectedpagetext', $right );
+                               //Users with 'editprotected' permission can edit protected pages
+                               if( $action=='edit' && $user->isAllowed( 'editprotected' ) ) {
+                                       //Users with 'editprotected' permission cannot edit protected pages
+                                       //with cascading option turned on.
+                                       if($this->mCascadeRestriction) {
+                                               $errors[] = array( 'protectedpagetext', $right );
+                                       } else {
+                                               //Nothing, user can edit!
+                                       }
+                               } else {
+                                       $errors[] = array( 'protectedpagetext', $right );
+                               }
                        }
                }