aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiQueryFilearchive.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/api/ApiQueryFilearchive.php')
-rw-r--r--includes/api/ApiQueryFilearchive.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/includes/api/ApiQueryFilearchive.php b/includes/api/ApiQueryFilearchive.php
index 5742c0860be5..2e3f6cc26bce 100644
--- a/includes/api/ApiQueryFilearchive.php
+++ b/includes/api/ApiQueryFilearchive.php
@@ -57,14 +57,10 @@ class ApiQueryFilearchive extends ApiQueryBase {
$fld_bitdepth = isset( $prop['bitdepth'] );
$fld_archivename = isset( $prop['archivename'] );
- if ( $fld_description &&
- !$this->getPermissionManager()->userHasRight( $user, 'deletedhistory' )
- ) {
+ if ( $fld_description && !$this->getAuthority()->isAllowed( 'deletedhistory' ) ) {
$this->dieWithError( 'apierror-cantview-deleted-description', 'permissiondenied' );
}
- if ( $fld_metadata &&
- !$this->getPermissionManager()->userHasAnyRight( $user, 'deletedtext', 'undelete' )
- ) {
+ if ( $fld_metadata && !$this->getAuthority()->isAllowedAny( 'deletedtext', 'undelete' ) ) {
$this->dieWithError( 'apierror-cantview-deleted-metadata', 'permissiondenied' );
}
@@ -119,11 +115,9 @@ class ApiQueryFilearchive extends ApiQueryBase {
if ( $sha1 ) {
$this->addWhereFld( 'fa_sha1', $sha1 );
// Paranoia: avoid brute force searches (T19342)
- if ( !$this->getPermissionManager()->userHasRight( $user, 'deletedtext' ) ) {
+ if ( !$this->getAuthority()->isAllowed( 'deletedtext' ) ) {
$bitmask = File::DELETED_FILE;
- } elseif ( !$this->getPermissionManager()
- ->userHasAnyRight( $user, 'suppressrevision', 'viewsuppressed' )
- ) {
+ } elseif ( !$this->getAuthority()->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
$bitmask = File::DELETED_FILE | File::DELETED_RESTRICTED;
} else {
$bitmask = 0;