From 42fcb726e6bf318e0df292c18ba84acfe5baf4d3 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 29 May 2012 19:09:01 +0200 Subject: [PATCH] Fix user rights check to display the "revert" link on file histories. * Don't do expensive checks for display (for the consistency of the interface) * Removed the logged-in check and changed it for 'upload' right (as the user need this right to execute the action) Change-Id: Ie5752e5292a953cbcf81ab665365c3efbd4eba6a --- includes/ImagePage.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 22984a5166..63e9894d73 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -1038,7 +1038,9 @@ class ImageHistoryList extends ContextSource { $row .= ''; if ( $iscur ) { $row .= wfMsgHtml( 'filehist-current' ); - } elseif ( $local && $user->isLoggedIn() && $this->title->userCan( 'edit' ) ) { + } elseif ( $local && $this->title->quickUserCan( 'edit' ) + && $this->title->quickUserCan( 'upload' ) + ) { if ( $file->isDeleted( File::DELETED_FILE ) ) { $row .= wfMsgHtml( 'filehist-revert' ); } else { -- 2.20.1