- && !( $this->moveOverShared && $user->isAllowed( 'reupload-shared' ) )
- && !RepoGroup::singleton()->getLocalRepo()->findFile( $nt )
- && MediaWikiServices::getInstance()->getRepoGroup()->findFile( $nt )
+ && !( $this->moveOverShared && $permissionManager->userHasRight( $user, 'reupload-shared' ) )
+ && !$repoGroup->getLocalRepo()->findFile( $nt )
+ && $repoGroup->findFile( $nt )