HHVM removal: Deprecate and simplify wfIsHHVM()
[lhc/web/wiklou.git] / includes / api / ApiUserrights.php
index 8f3c404..3aaae70 100644 (file)
@@ -51,7 +51,7 @@ 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' ) ) {
+               if ( !$this->getPermissionManager()->userHasRight( $pUser, 'userrights' ) ) {
                        $block = $pUser->getBlock();
                        if ( $block && $block->isSitewide() ) {
                                $this->dieBlocked( $block );
@@ -112,6 +112,7 @@ class ApiUserrights extends ApiBase {
 
                $form = $this->getUserRightsPage();
                $form->setContext( $this->getContext() );
+               $r = [];
                $r['user'] = $user->getName();
                $r['userid'] = $user->getId();
                list( $r['added'], $r['removed'] ) = $form->doSaveUserGroups(