From: David Barratt Date: Fri, 19 Jul 2019 17:37:27 +0000 (-0400) Subject: Users with partial access to user rights should not be blocked X-Git-Tag: 1.34.0-rc.0~897^2 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=99464419036da1a9e660efab483d52aa517f294f;p=lhc%2Fweb%2Fwiklou.git Users with partial access to user rights should not be blocked If a user has partial access to modify user rights, their partial access should not be blocked because of a partial block. Bug: T228534 Change-Id: I7479953f1ef99d437184e5cbbe06adedf5b7a47b --- diff --git a/includes/api/ApiUserrights.php b/includes/api/ApiUserrights.php index acb3da8fb1..8f3c404116 100644 --- a/includes/api/ApiUserrights.php +++ b/includes/api/ApiUserrights.php @@ -52,10 +52,8 @@ class ApiUserrights extends ApiBase { // Deny if the user is blocked and doesn't have the full 'userrights' permission. // This matches what Special:UserRights does for the web UI. if ( !$pUser->isAllowed( 'userrights' ) ) { - // @TODO Should the user be blocked from changing user rights if they - // are partially blocked? $block = $pUser->getBlock(); - if ( $block ) { + if ( $block && $block->isSitewide() ) { $this->dieBlocked( $block ); } } diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index a8ff32fa90..87534eb885 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -161,11 +161,9 @@ class UserrightsPage extends SpecialPage { * allow them to change any user rights. */ if ( !$user->isAllowed( 'userrights' ) ) { - // @TODO Should the user be blocked from changing user rights if they - // are partially blocked? $block = $user->getBlock(); - if ( $block ) { - throw new UserBlockedError( $user->getBlock() ); + if ( $block && $block->isSitewide() ) { + throw new UserBlockedError( $block ); } }