Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -432,8 +432,8 @@ |
433 | 433 | } |
434 | 434 | } |
435 | 435 | |
436 | | - global $wgUser; |
437 | | - if ( $module->isReadMode() && !$wgUser->isAllowed( 'read' ) ) |
| 436 | + global $wgUser, $wgGroupPermissions; |
| 437 | + if ( $module->isReadMode() && !$wgGroupPermissions['*']['read'] && !$wgUser->isAllowed( 'read' ) ) |
438 | 438 | $this->dieUsageMsg( array( 'readrequired' ) ); |
439 | 439 | if ( $module->isWriteMode() ) { |
440 | 440 | if ( !$this->mEnableWrite ) |
Index: trunk/phase3/includes/api/ApiOpenSearch.php |
— | — | @@ -42,15 +42,15 @@ |
43 | 43 | } |
44 | 44 | |
45 | 45 | public function execute() { |
46 | | - global $wgEnableOpenSearchSuggest, $wgSearchSuggestCacheExpiry, $wgGroupPermissions, $wgUser; |
| 46 | + global $wgEnableOpenSearchSuggest, $wgSearchSuggestCacheExpiry; |
47 | 47 | $params = $this->extractRequestParams(); |
48 | 48 | $search = $params['search']; |
49 | 49 | $limit = $params['limit']; |
50 | 50 | $namespaces = $params['namespace']; |
51 | 51 | $suggest = $params['suggest']; |
52 | 52 | |
53 | | - // MWSuggest or similar hit, or hit without read rights |
54 | | - if ( ( $suggest && !$wgEnableOpenSearchSuggest ) || ( !$wgGroupPermissions['*']['read'] && !$wgUser->isAllowed( 'read' ) ) ) |
| 53 | + // MWSuggest or similar hit |
| 54 | + if ( $suggest && !$wgEnableOpenSearchSuggest ) |
55 | 55 | $srchres = array(); |
56 | 56 | else { |
57 | 57 | // Open search results may be stored for a very long |
— | — | @@ -108,8 +108,4 @@ |
109 | 109 | public function getVersion() { |
110 | 110 | return __CLASS__ . ': $Id$'; |
111 | 111 | } |
112 | | - |
113 | | - public function isReadMode() { |
114 | | - return false; |
115 | | - } |
116 | 112 | } |