Merge "Make Special:ChangeContentModel field labels consistently use colons"
[lhc/web/wiklou.git] / includes / api / ApiUserrights.php
index acb3da8..89ec6cb 100644 (file)
@@ -51,11 +51,9 @@ 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?
+               if ( !$this->getPermissionManager()->userHasRight( $pUser, 'userrights' ) ) {
                        $block = $pUser->getBlock();
-                       if ( $block ) {
+                       if ( $block && $block->isSitewide() ) {
                                $this->dieBlocked( $block );
                        }
                }