From: Dayllan Maza Date: Fri, 29 Mar 2019 17:13:22 +0000 (-0400) Subject: Fix partially blocked admin undelete permissions X-Git-Tag: 1.34.0-rc.0~2232^2 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=ab66b66c25cc2ffdbc29495adc1d49a491225387;p=lhc%2Fweb%2Fwiklou.git Fix partially blocked admin undelete permissions If an admin is partially blocked they should be able to restore/undelete any given page. Bug: T219305 Change-Id: I404730273c33d72d7552cd69e93ccec78c5fad5a --- diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index 07a6aae9eb..5f9b97c457 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -31,7 +31,8 @@ class ApiUndelete extends ApiBase { $params = $this->extractRequestParams(); $user = $this->getUser(); - if ( $user->isBlocked() ) { + $block = $user->getBlock(); + if ( $block && $block->isSitewide() ) { $this->dieBlocked( $user->getBlock() ); } diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index 529c33185e..7d6c41ab2d 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -95,7 +95,8 @@ class SpecialUndelete extends SpecialPage { $this->mUnsuppress = $request->getVal( 'wpUnsuppress' ) && $user->isAllowed( 'suppressrevision' ); $this->mToken = $request->getVal( 'token' ); - if ( $this->isAllowed( 'undelete' ) && !$user->isBlocked() ) { + $block = $user->getBlock(); + if ( $this->isAllowed( 'undelete' ) && !( $block && $block->isSitewide() ) ) { $this->mAllowed = true; // user can restore $this->mCanView = true; // user can view content } elseif ( $this->isAllowed( 'deletedtext' ) ) {