From: Alexandre Emsenhuber Date: Tue, 29 May 2012 17:09:01 +0000 (+0200) Subject: Fix user rights check to display the "revert" link on file histories. X-Git-Tag: 1.31.0-rc.0~23473 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=42fcb726e6bf318e0df292c18ba84acfe5baf4d3;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 {