Index: branches/wmf-deployment/includes/filerepo/OldLocalFile.php |
— | — | @@ -197,9 +197,14 @@ |
198 | 198 | function userCan( $field ) { |
199 | 199 | if( isset($this->deleted) && ($this->deleted & $field) ) { |
200 | 200 | global $wgUser; |
201 | | - $permission = ( $this->deleted & File::DELETED_RESTRICTED ) |
202 | | - ? 'suppressrevision' |
203 | | - : ( $field & File::DELETED_FILE ) ? 'deletedtext' : 'deletedhistory'; |
| 201 | + $permission = ''; |
| 202 | + if ( $this->deleted & self::DELETED_RESTRICTED ) { |
| 203 | + $permission = 'suppressrevision'; |
| 204 | + } elseif ( $field & self::DELETED_TEXT ) { |
| 205 | + $permission = 'deletedtext'; |
| 206 | + } else { |
| 207 | + $permission = 'deletedhistory'; |
| 208 | + } |
204 | 209 | wfDebug( "Checking for $permission due to $field match on $this->mDeleted\n" ); |
205 | 210 | return $wgUser->isAllowed( $permission ); |
206 | 211 | } else { |
Index: branches/wmf-deployment/includes/filerepo/ArchivedFile.php |
— | — | @@ -379,9 +379,14 @@ |
380 | 380 | $this->load(); |
381 | 381 | if( $this->deleted & $field ) { |
382 | 382 | global $wgUser; |
383 | | - $permission = ( $this->deleted & File::DELETED_RESTRICTED ) |
384 | | - ? 'suppressrevision' |
385 | | - : ( $field & File::DELETED_FILE ) ? 'deletedtext' : 'deletedhistory'; |
| 383 | + $permission = ''; |
| 384 | + if ( $this->deleted & self::DELETED_RESTRICTED ) { |
| 385 | + $permission = 'suppressrevision'; |
| 386 | + } elseif ( $field & self::DELETED_TEXT ) { |
| 387 | + $permission = 'deletedtext'; |
| 388 | + } else { |
| 389 | + $permission = 'deletedhistory'; |
| 390 | + } |
386 | 391 | wfDebug( "Checking for $permission due to $field match on $this->deleted\n" ); |
387 | 392 | return $wgUser->isAllowed( $permission ); |
388 | 393 | } else { |
Index: branches/wmf-deployment/includes/LogEventsList.php |
— | — | @@ -549,9 +549,14 @@ |
550 | 550 | public static function userCan( $row, $field ) { |
551 | 551 | if( $row->log_deleted & $field ) { |
552 | 552 | global $wgUser; |
553 | | - $permission = ( $row->log_deleted & LogPage::DELETED_RESTRICTED ) |
554 | | - ? 'suppressrevision' |
555 | | - : 'deletedhistory'; |
| 553 | + $permission = ''; |
| 554 | + if ( $this->log_deleted & self::DELETED_RESTRICTED ) { |
| 555 | + $permission = 'suppressrevision'; |
| 556 | + } elseif ( $field & self::DELETED_TEXT ) { |
| 557 | + $permission = 'deletedtext'; |
| 558 | + } else { |
| 559 | + $permission = 'deletedhistory'; |
| 560 | + } |
556 | 561 | wfDebug( "Checking for $permission due to $field match on $row->log_deleted\n" ); |
557 | 562 | return $wgUser->isAllowed( $permission ); |
558 | 563 | } else { |
Index: branches/wmf-deployment/includes/Revision.php |
— | — | @@ -979,7 +979,6 @@ |
980 | 980 | public function userCan( $field ) { |
981 | 981 | if( $this->mDeleted & $field ) { |
982 | 982 | global $wgUser; |
983 | | - |
984 | 983 | $permission = ''; |
985 | 984 | if ( $this->mDeleted & self::DELETED_RESTRICTED ) { |
986 | 985 | $permission = 'suppressrevision'; |
— | — | @@ -988,7 +987,6 @@ |
989 | 988 | } else { |
990 | 989 | $permission = 'deletedhistory'; |
991 | 990 | } |
992 | | - |
993 | 991 | wfDebug( "Checking for $permission due to $field match on $this->mDeleted\n" ); |
994 | 992 | return $wgUser->isAllowed( $permission ); |
995 | 993 | } else { |
Index: branches/wmf-deployment/includes/ChangesList.php |
— | — | @@ -448,9 +448,14 @@ |
449 | 449 | public static function userCan( $rc, $field ) { |
450 | 450 | if( $rc->mAttribs['rc_deleted'] & $field ) { |
451 | 451 | global $wgUser; |
452 | | - $permission = ( $rc->mAttribs['rc_deleted'] & Revision::DELETED_RESTRICTED ) |
453 | | - ? 'suppressrevision' |
454 | | - : ( $field & Revision::DELETED_TEXT ) ? 'deletedtext' : 'deletedhistory'; |
| 452 | + $permission = ''; |
| 453 | + if ( $rc->mAttribs['rc_deleted'] & self::DELETED_RESTRICTED ) { |
| 454 | + $permission = 'suppressrevision'; |
| 455 | + } elseif ( $field & self::DELETED_TEXT ) { |
| 456 | + $permission = 'deletedtext'; |
| 457 | + } else { |
| 458 | + $permission = 'deletedhistory'; |
| 459 | + } |
455 | 460 | wfDebug( "Checking for $permission due to $field match on {$rc->mAttribs['rc_deleted']}\n" ); |
456 | 461 | return $wgUser->isAllowed( $permission ); |
457 | 462 | } else { |