Merge "objectcache: Remove lock()/unlock() stubs from MemcachedClient"
[lhc/web/wiklou.git] / includes / api / ApiQueryAllDeletedRevisions.php
index beaad43..4eead4c 100644 (file)
@@ -143,14 +143,8 @@ class ApiQueryAllDeletedRevisions extends ApiQueryRevisionsBase {
                        }
                }
 
+               // This means stricter restrictions
                if ( $this->fetchContent ) {
-                       $this->addTables( 'text' );
-                       $this->addJoinConds(
-                               [ 'text' => [ 'LEFT JOIN', [ 'ar_text_id=old_id' ] ] ]
-                       );
-                       $this->addFields( [ 'old_text', 'old_flags' ] );
-
-                       // This also means stricter restrictions
                        $this->checkUserRightsAny( [ 'deletedtext', 'undelete' ] );
                }
 
@@ -243,7 +237,7 @@ class ApiQueryAllDeletedRevisions extends ApiQueryRevisionsBase {
                        // Paranoia: avoid brute force searches (T19342)
                        // (shouldn't be able to get here without 'deletedhistory', but
                        // check it again just in case)
-                       if ( !$user->isAllowed( 'deletedhistory' ) ) {
+                       if ( !$this->getPermissionManager()->userHasRight( $user, 'deletedhistory' ) ) {
                                $bitmask = RevisionRecord::DELETED_USER;
                        } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
                                $bitmask = RevisionRecord::DELETED_USER | RevisionRecord::DELETED_RESTRICTED;