Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -467,11 +467,12 @@ |
468 | 468 | } |
469 | 469 | |
470 | 470 | private $mIsBot = null; |
471 | | - |
472 | 471 | private $mIsSysop = null; |
| 472 | + private $mCanApiHighLimits = null; |
473 | 473 | |
474 | 474 | /** |
475 | 475 | * Returns true if the currently logged in user is a bot, false otherwise |
| 476 | + * OBSOLETE, use canApiHighLimits() instead |
476 | 477 | */ |
477 | 478 | public function isBot() { |
478 | 479 | if (!isset ($this->mIsBot)) { |
— | — | @@ -484,6 +485,7 @@ |
485 | 486 | /** |
486 | 487 | * Similar to isBot(), this method returns true if the logged in user is |
487 | 488 | * a sysop, and false if not. |
| 489 | + * OBSOLETE, use canApiHighLimits() instead |
488 | 490 | */ |
489 | 491 | public function isSysop() { |
490 | 492 | if (!isset ($this->mIsSysop)) { |
— | — | @@ -493,7 +495,16 @@ |
494 | 496 | |
495 | 497 | return $this->mIsSysop; |
496 | 498 | } |
| 499 | + |
| 500 | + public function canApiHighLimits() { |
| 501 | + if (!is_null ($this->mCanApiHighLimits)) { |
| 502 | + global $wgUser; |
| 503 | + $this->mCanApiHighLimits = $wgUser->isAllowed('apihighlimits'); |
| 504 | + } |
497 | 505 | |
| 506 | + return $this->mCanApiHighLimits; |
| 507 | + } |
| 508 | + |
498 | 509 | public function getShowVersions() { |
499 | 510 | return $this->mShowVersions; |
500 | 511 | } |
Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -485,7 +485,7 @@ |
486 | 486 | / Optimization: do not check user's bot status unless really needed -- skips db query |
487 | 487 | / assumes $botMax >= $max |
488 | 488 | if (!is_null($max) && $value > $max) { |
489 | | - if (!is_null($botMax) && ($this->getMain()->isBot() || $this->getMain()->isSysop())) { |
| 489 | + if (!is_null($botMax) && ($this->getMain()->canApiHighLimits())) { |
490 | 490 | if ($value > $botMax) { |
491 | 491 | $this->dieUsage($this->encodeParamName($paramName) . " may not be over $botMax (set to $value) for bots or sysops", $paramName); |
492 | 492 | } |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1072,6 +1072,7 @@ |
1073 | 1073 | $wgGroupPermissions['bot' ]['nominornewtalk'] = true; |
1074 | 1074 | $wgGroupPermissions['bot' ]['autopatrol'] = true; |
1075 | 1075 | $wgGroupPermissions['bot' ]['suppressredirect'] = true; |
| 1076 | +$wgGroupPermissions['bot' ]['apihighlimits'] = true; |
1076 | 1077 | |
1077 | 1078 | / Most extra permission abilities go to this group |
1078 | 1079 | $wgGroupPermissions['sysop']['block'] = true; |
— | — | @@ -1099,6 +1100,7 @@ |
1100 | 1101 | $wgGroupPermissions['sysop']['blockemail'] = true; |
1101 | 1102 | $wgGroupPermissions['sysop']['markbotedits'] = true; |
1102 | 1103 | $wgGroupPermissions['sysop']['suppressredirect'] = true; |
| 1104 | +$wgGroupPermissions['sysop']['apihighlimits'] = true; |
1103 | 1105 | #$wgGroupPermissions['sysop']['mergehistory'] = true; |
1104 | 1106 | |
1105 | 1107 | / Permission to change users' group assignments |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -196,7 +196,6 @@ |
197 | 197 | for users with special characters in their names |
198 | 198 | * The number of watching users in watchlists was always reported as 1 |
199 | 199 | * namespaceDupes.php no longer dies when coming across an illegal title |
200 | | -* Make API check for restrictions in the old format too. |
201 | 200 | * (bug 12143) Do not show a link to patrol new pages for non existent pages |
202 | 201 | |
203 | 202 | == Parser changes in 1.12 == |
— | — | @@ -302,6 +301,8 @@ |
303 | 302 | * (bug 11206) api.php should honor maxlag |
304 | 303 | * Added diff generation to prop=revisions |
305 | 304 | * Added support for traditional, unified and array diffs to prop=revisions |
| 305 | +* Make prop=info check for restrictions in the old format too. |
| 306 | +* Add apihighlimits permission, default for sysops and bots |
306 | 307 | |
307 | 308 | === Languages updated in 1.12 === |
308 | 309 | |