$flags |= EDIT_MINOR;
}
- if ( $bot && ( $wgUser->isAllowed( 'markbotedits', 'bot' ) ) ) {
+ if ( $bot && ( $wgUser->isAllowedAny( 'markbotedits', 'bot' ) ) ) {
$flags |= EDIT_FORCE_BOT;
}
$del = '';
// Show checkboxes for each revision
- if ( $wgUser->isAllowed( 'deleterevision', 'revisionmove' ) ) {
+ if ( $wgUser->isAllowedAny( 'deleterevision', 'revisionmove' ) ) {
$this->preventClickjacking();
// If revision was hidden from sysops, disable the checkbox
// However, if the user has revisionmove rights, we cannot disable the checkbox
. $navLinks . "\n"
. Xml::openElement( 'table', array( 'class' => 'wikitable filehistory' ) ) . "\n"
. '<tr><td></td>'
- . ( $this->current->isLocal() && ( $wgUser->isAllowed( 'delete', 'deletedhistory' ) ) ? '<td></td>' : '' )
+ . ( $this->current->isLocal() && ( $wgUser->isAllowedAny( 'delete', 'deletedhistory' ) ) ? '<td></td>' : '' )
. '<th>' . wfMsgHtml( 'filehist-datetime' ) . '</th>'
. ( $this->showThumb ? '<th>' . wfMsgHtml( 'filehist-thumb' ) . '</th>' : '' )
. '<th>' . wfMsgHtml( 'filehist-dimensions' ) . '</th>'
$row = $selected = '';
// Deletion link
- if ( $local && ( $wgUser->isAllowed( 'delete', 'deletedhistory' ) ) ) {
+ if ( $local && ( $wgUser->isAllowedAny( 'delete', 'deletedhistory' ) ) ) {
$row .= '<td>';
# Link to remove from history
if ( $wgUser->isAllowed( 'delete' ) ) {
// Prevent users from setting levels that they cannot later unset
if( $val == 'sysop' ) {
// Special case, rewrite sysop to either protect and editprotected
- if( !$wgUser->isAllowed( 'protect', 'editprotected' ) )
+ if( !$wgUser->isAllowedAny( 'protect', 'editprotected' ) )
continue;
} else {
if( !$wgUser->isAllowed($val) )
//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
if( $key == 'sysop' ) {
//special case, rewrite sysop to protect and editprotected
- if( !$wgUser->isAllowed( 'protect', 'editprotected' ) && !$this->disabled )
+ if( !$wgUser->isAllowedAny( 'protect', 'editprotected' ) && !$this->disabled )
continue;
} else {
if( !$wgUser->isAllowed($key) && !$this->disabled )
* @param varargs String permissions to test
* @return Boolean: True if user is allowed to perform *any* of the given actions
*/
- public function isAllowed( /*...*/ ){
+ public function isAllowedAny( /*...*/ ){
$permissions = func_get_args();
foreach( $permissions as $permission ){
if( $this->isAllowedInternal( $permission ) ){
* @param $action String
* @return bool
*/
- private function isAllowedInternal( $action = '' ) {
+ public function isAllowed( $action = '' ) {
if ( $action === '' ) {
return true; // In the spirit of DWIM
}
private function showForm() {
global $wgUser, $wgOut, $wgImportSources, $wgExportMaxLinkDepth;
- if( !$wgUser->isAllowed( 'import', 'importupload' ) )
+ if( !$wgUser->isAllowedAny( 'import', 'importupload' ) )
return $wgOut->permissionRequired( 'import' );
$action = $this->getTitle()->getLocalUrl( array( 'action' => 'submit' ) );