Merge "maintenance: Cleanup db code and bogus RevisionRecord constants in NamespaceDupes"
[lhc/web/wiklou.git] / includes / api / ApiQueryFilearchive.php
index ebffb15..f9087eb 100644 (file)
@@ -24,6 +24,8 @@
  * @file
  */
 
+use MediaWiki\Revision\RevisionRecord;
+
 /**
  * Query module to enumerate all deleted files.
  *
@@ -112,9 +114,11 @@ class ApiQueryFilearchive extends ApiQueryBase {
                }
 
                // Exclude files this user can't view.
-               if ( !$user->isAllowed( 'deletedtext' ) ) {
+               if ( !$this->getPermissionManager()->userHasRight( $user, 'deletedtext' ) ) {
                        $bitmask = File::DELETED_FILE;
-               } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
+               } elseif ( !$this->getPermissionManager()
+                       ->userHasAnyRight( $user, 'suppressrevision', 'viewsuppressed' )
+               ) {
                        $bitmask = File::DELETED_FILE | File::DELETED_RESTRICTED;
                } else {
                        $bitmask = 0;
@@ -153,7 +157,7 @@ class ApiQueryFilearchive extends ApiQueryBase {
                        self::addTitleInfo( $file, $title );
 
                        if ( $fld_description &&
-                               Revision::userCanBitfield( $row->fa_deleted, File::DELETED_COMMENT, $user )
+                               RevisionRecord::userCanBitfield( $row->fa_deleted, File::DELETED_COMMENT, $user )
                        ) {
                                $file['description'] = $commentStore->getComment( 'fa_description', $row )->text;
                                if ( isset( $prop['parseddescription'] ) ) {
@@ -162,7 +166,7 @@ class ApiQueryFilearchive extends ApiQueryBase {
                                }
                        }
                        if ( $fld_user &&
-                               Revision::userCanBitfield( $row->fa_deleted, File::DELETED_USER, $user )
+                               RevisionRecord::userCanBitfield( $row->fa_deleted, File::DELETED_USER, $user )
                        ) {
                                $file['userid'] = (int)$row->fa_user;
                                $file['user'] = $row->fa_user_text;