Index: trunk/extensions/WikimediaIncubator/IncubatorTest.php |
— | — | @@ -309,9 +309,7 @@ |
310 | 310 | * @return Boolean |
311 | 311 | */ |
312 | 312 | static function onGetUserPermissionsErrors( $title, $user, $action, &$result ) { |
313 | | - if ( $action == 'read' ) { |
314 | | - return true; |
315 | | - } |
| 313 | + $notAllowedActions = in_array( array( 'edit', 'createpage' ) ); |
316 | 314 | |
317 | 315 | $titletext = $title->getText(); |
318 | 316 | $prefixdata = self::analyzePrefix( $titletext ); |
— | — | @@ -329,7 +327,7 @@ |
330 | 328 | # faking external link to support prot-rel URLs |
331 | 329 | $link = "[$link ". self::makeExternalLinkText( $link ) . "]"; |
332 | 330 | $result[] = array( 'wminc-error-wiki-exists', $link ); |
333 | | - return $action == 'delete' ? true : false; |
| 331 | + return $notAllowedActions ? false : true; |
334 | 332 | } |
335 | 333 | |
336 | 334 | if( !self::shouldWeShowUnprefixedError( $title ) || $action != 'create' ) { |
— | — | @@ -348,7 +346,7 @@ |
349 | 347 | $error = 'wminc-error-unprefixed'; |
350 | 348 | } |
351 | 349 | $result = $error; |
352 | | - return false; |
| 350 | + return $notAllowedActions ? false : true; |
353 | 351 | } |
354 | 352 | |
355 | 353 | /** |