PermissionManager doesn't exist in 1.33, so we cannot use it in 1.31
authorReedy <reedy@wikimedia.org>
Fri, 11 Oct 2019 23:36:47 +0000 (00:36 +0100)
committerReedy <reedy@wikimedia.org>
Fri, 11 Oct 2019 23:39:35 +0000 (23:39 +0000)
Followup T230402, PermissionManager doesn't exist until 1.33, so fix the
backported patches to use User::isAllowed() instead.

Change-Id: Ia73bf71293d67f97fb5086ffc0384307568d4d43

RELEASE-NOTES-1.31
includes/specials/SpecialRedirect.php

index c2bb334..10cc2e6 100644 (file)
@@ -3,6 +3,8 @@
 THIS IS NOT A RELEASE YET
 
 === Changes since MediaWiki 1.31.4 ===
+* Followup T230402, PermissionManager doesn't exist until 1.33, so fix the
+  backported patches to use User::isAllowed() instead.
 
 == MediaWiki 1.31.4 ==
 
index 7eba0de..27176c4 100644 (file)
@@ -81,9 +81,7 @@ class SpecialRedirect extends FormSpecialPage {
                        // Message: redirect-not-exists
                        return Status::newFatal( $this->getMessagePrefix() . '-not-exists' );
                }
-               if ( $user->isHidden() && !MediaWikiServices::getInstance()->getPermissionManager()
-                       ->userHasRight( $this->getUser(), 'hideuser' )
-               ) {
+               if ( $user->isHidden() && !$this->getUser()->isAllowed( 'hideuser' ) ) {
                        throw new PermissionsError( null, [ 'badaccess-group0' ] );
                }
                $userpage = Title::makeTitle( NS_USER, $username );