public function imageHistoryLine( $iscur, $file ) {
$user = $this->getUser();
$lang = $this->getLanguage();
+ $pm = MediaWikiServices::getInstance()->getPermissionManager();
$timestamp = wfTimestamp( TS_MW, $file->getTimestamp() );
+ // @phan-suppress-next-line PhanUndeclaredMethod
$img = $iscur ? $file->getName() : $file->getArchiveName();
$userId = $file->getUser( 'id' );
$userText = $file->getUser( 'text' );
$row = $selected = '';
// Deletion link
- if ( $local && ( MediaWikiServices::getInstance()
- ->getPermissionManager()
- ->userHasAnyRight( $user, 'delete', 'deletedhistory' ) )
+ if ( $local && ( $pm->userHasAnyRight( $user, 'delete', 'deletedhistory' ) )
) {
$row .= '<td>';
# Link to remove from history
$row .= '<td>';
if ( $iscur ) {
$row .= $this->msg( 'filehist-current' )->escaped();
- } elseif ( $local && $this->title->quickUserCan( 'edit', $user )
- && $this->title->quickUserCan( 'upload', $user )
+ } elseif ( $local && $pm->quickUserCan( 'edit', $user, $this->title )
+ && $pm->quickUserCan( 'upload', $user, $this->title )
) {
if ( $file->isDeleted( File::DELETED_FILE ) ) {
$row .= $this->msg( 'filehist-revert' )->escaped();