Index: trunk/phase3/includes/ProtectionForm.php |
— | — | @@ -133,7 +133,7 @@ |
134 | 134 | // Prevent users from setting levels that they cannot later unset |
135 | 135 | if( $val == 'sysop' ) { |
136 | 136 | // Special case, rewrite sysop to either protect and editprotected |
137 | | - if( !$wgUser->isAllowed( 'protect', 'editprotected' ) ) |
| 137 | + if( !$wgUser->isAllowedAny( 'protect', 'editprotected' ) ) |
138 | 138 | continue; |
139 | 139 | } else { |
140 | 140 | if( !$wgUser->isAllowed($val) ) |
— | — | @@ -527,7 +527,7 @@ |
528 | 528 | //don't let them choose levels above their own (aka so they can still unprotect and edit the page). but only when the form isn't disabled |
529 | 529 | if( $key == 'sysop' ) { |
530 | 530 | //special case, rewrite sysop to protect and editprotected |
531 | | - if( !$wgUser->isAllowed( 'protect', 'editprotected' ) && !$this->disabled ) |
| 531 | + if( !$wgUser->isAllowedAny( 'protect', 'editprotected' ) && !$this->disabled ) |
532 | 532 | continue; |
533 | 533 | } else { |
534 | 534 | if( !$wgUser->isAllowed($key) && !$this->disabled ) |
Index: trunk/phase3/includes/User.php |
— | — | @@ -2248,7 +2248,7 @@ |
2249 | 2249 | * @param varargs String permissions to test |
2250 | 2250 | * @return Boolean: True if user is allowed to perform *any* of the given actions |
2251 | 2251 | */ |
2252 | | - public function isAllowed( /*...*/ ){ |
| 2252 | + public function isAllowedAny( /*...*/ ){ |
2253 | 2253 | $permissions = func_get_args(); |
2254 | 2254 | foreach( $permissions as $permission ){ |
2255 | 2255 | if( $this->isAllowedInternal( $permission ) ){ |
— | — | @@ -2277,7 +2277,7 @@ |
2278 | 2278 | * @param $action String |
2279 | 2279 | * @return bool |
2280 | 2280 | */ |
2281 | | - private function isAllowedInternal( $action = '' ) { |
| 2281 | + public function isAllowed( $action = '' ) { |
2282 | 2282 | if ( $action === '' ) { |
2283 | 2283 | return true; // In the spirit of DWIM |
2284 | 2284 | } |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -3458,7 +3458,7 @@ |
3459 | 3459 | $flags |= EDIT_MINOR; |
3460 | 3460 | } |
3461 | 3461 | |
3462 | | - if ( $bot && ( $wgUser->isAllowed( 'markbotedits', 'bot' ) ) ) { |
| 3462 | + if ( $bot && ( $wgUser->isAllowedAny( 'markbotedits', 'bot' ) ) ) { |
3463 | 3463 | $flags |= EDIT_FORCE_BOT; |
3464 | 3464 | } |
3465 | 3465 | |
Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -930,7 +930,7 @@ |
931 | 931 | . $navLinks . "\n" |
932 | 932 | . Xml::openElement( 'table', array( 'class' => 'wikitable filehistory' ) ) . "\n" |
933 | 933 | . '<tr><td></td>' |
934 | | - . ( $this->current->isLocal() && ( $wgUser->isAllowed( 'delete', 'deletedhistory' ) ) ? '<td></td>' : '' ) |
| 934 | + . ( $this->current->isLocal() && ( $wgUser->isAllowedAny( 'delete', 'deletedhistory' ) ) ? '<td></td>' : '' ) |
935 | 935 | . '<th>' . wfMsgHtml( 'filehist-datetime' ) . '</th>' |
936 | 936 | . ( $this->showThumb ? '<th>' . wfMsgHtml( 'filehist-thumb' ) . '</th>' : '' ) |
937 | 937 | . '<th>' . wfMsgHtml( 'filehist-dimensions' ) . '</th>' |
— | — | @@ -961,7 +961,7 @@ |
962 | 962 | $row = $selected = ''; |
963 | 963 | |
964 | 964 | // Deletion link |
965 | | - if ( $local && ( $wgUser->isAllowed( 'delete', 'deletedhistory' ) ) ) { |
| 965 | + if ( $local && ( $wgUser->isAllowedAny( 'delete', 'deletedhistory' ) ) ) { |
966 | 966 | $row .= '<td>'; |
967 | 967 | # Link to remove from history |
968 | 968 | if ( $wgUser->isAllowed( 'delete' ) ) { |
Index: trunk/phase3/includes/HistoryPage.php |
— | — | @@ -510,7 +510,7 @@ |
511 | 511 | |
512 | 512 | $del = ''; |
513 | 513 | // Show checkboxes for each revision |
514 | | - if ( $wgUser->isAllowed( 'deleterevision', 'revisionmove' ) ) { |
| 514 | + if ( $wgUser->isAllowedAny( 'deleterevision', 'revisionmove' ) ) { |
515 | 515 | $this->preventClickjacking(); |
516 | 516 | // If revision was hidden from sysops, disable the checkbox |
517 | 517 | // However, if the user has revisionmove rights, we cannot disable the checkbox |
Index: trunk/phase3/includes/specials/SpecialImport.php |
— | — | @@ -144,7 +144,7 @@ |
145 | 145 | |
146 | 146 | private function showForm() { |
147 | 147 | global $wgUser, $wgOut, $wgImportSources, $wgExportMaxLinkDepth; |
148 | | - if( !$wgUser->isAllowed( 'import', 'importupload' ) ) |
| 148 | + if( !$wgUser->isAllowedAny( 'import', 'importupload' ) ) |
149 | 149 | return $wgOut->permissionRequired( 'import' ); |
150 | 150 | |
151 | 151 | $action = $this->getTitle()->getLocalUrl( array( 'action' => 'submit' ) ); |