Merge "Users with partial access to user rights should not be blocked"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 24 Jul 2019 12:44:47 +0000 (12:44 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 24 Jul 2019 12:44:47 +0000 (12:44 +0000)
includes/api/ApiUserrights.php
includes/specials/SpecialUserrights.php

index acb3da8..8f3c404 100644 (file)
@@ -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 );
                        }
                }
index a8ff32f..87534eb 100644 (file)
@@ -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 );
                                }
                        }