*/
protected function isAllowed( $permission, User $user = null ) {
$user = $user ?: $this->getUser();
+ $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
+
if ( $this->mTargetObj !== null ) {
- return $this->mTargetObj->userCan( $permission, $user );
+ return $permissionManager->userCan( $permission, $user, $this->mTargetObj );
} else {
return $user->isAllowed( $permission );
}
if ( $this->mTimestamp !== '' ) {
$this->showRevision( $this->mTimestamp );
} elseif ( $this->mFilename !== null && $this->mTargetObj->inNamespace( NS_FILE ) ) {
- $file = new ArchivedFile( $this->mTargetObj, '', $this->mFilename );
+ $file = new ArchivedFile( $this->mTargetObj, 0, $this->mFilename );
// Check if user is allowed to see this file
if ( !$file->exists() ) {
$out->addWikiMsg( 'filedelete-nofile', $this->mFilename );
$out = $this->getOutput();
$lang = $this->getLanguage();
$user = $this->getUser();
- $file = new ArchivedFile( $this->mTargetObj, '', $this->mFilename );
+ $file = new ArchivedFile( $this->mTargetObj, 0, $this->mFilename );
$out->addWikiMsg( 'undelete-show-file-confirm',
$this->mTargetObj->getText(),
$lang->userDate( $file->getTimestamp(), $user ),
$repo = RepoGroup::singleton()->getLocalRepo();
$path = $repo->getZonePath( 'deleted' ) . '/' . $repo->getDeletedHashPath( $key ) . $key;
- $repo->streamFile( $path );
+ $repo->streamFileWithStatus( $path );
}
protected function showHistory() {