API: Migrate Title::userCan() calls to PermissionManager
[lhc/web/wiklou.git] / includes / api / ApiQuery.php
index ae6b1a1..7cbd3ef 100644 (file)
@@ -429,10 +429,9 @@ class ApiQuery extends ApiBase {
                $exportTitles = [];
                $titles = $pageSet->getGoodTitles();
                if ( count( $titles ) ) {
-                       $user = $this->getUser();
                        /** @var Title $title */
                        foreach ( $titles as $title ) {
-                               if ( $title->userCan( 'read', $user ) ) {
+                               if ( $this->getPermissionManager()->userCan( 'read', $this->getUser(), $title ) ) {
                                        $exportTitles[] = $title;
                                }
                        }