r24025 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24024‎ | r24025 | r24026 >
Date:06:54, 12 July 2007
Author:yurik
Status:old
Tags:
Comment:
API: Per IRC discussion with brion and co, now API only works if the user has the right to read
Modified paths:
  • /trunk/phase3/includes/api/ApiMain.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiMain.php
@@ -92,6 +92,20 @@
9393 // Special handling for the main module: $parent === $this
9494 parent :: __construct($this, $this->mInternalMode ? 'main_int' : 'main');
9595
 96+ if (!$this->mInternalMode) {
 97+
 98+ // Impose module restrictions.
 99+ // If the current user cannot read,
 100+ // Remove all modules other than login & help
 101+ global $wgUser, $wgWhitelistRead;
 102+ if (!$wgUser->isAllowed('read')) {
 103+ self::$Modules = array(
 104+ 'login' => self::$Modules['login'],
 105+ 'help' => self::$Modules['help']
 106+ );
 107+ }
 108+ }
 109+
96110 $this->mModules = self :: $Modules;
97111 $this->mModuleNames = array_keys($this->mModules); // todo: optimize
98112 $this->mFormats = self :: $Formats;

Follow-up revisions

RevisionCommit summaryAuthorDate
r24096Merged revisions 23910-24094 via svnmerge from...david22:38, 14 July 2007

Status & tagging log