r45255 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45254‎ | r45255 | r45256 >
Date:21:16, 31 December 2008
Author:brion
Status:ok
Tags:
Comment:
Revert r45166 "Use quickUserCan for UI links"
Use of quickUserCan should be minimized to cases where maximal view speed is more important than accuracy, such as UI that's plastered on every page view.
In page history we're already headed into editor territory, and having an accurate idea of what we can do with editing tools (such as rollback) is relatively important.
Unless it can be shown that checking for cascading protections is a serious problem for site performance, we should continue using accurate checks here.
Modified paths:
  • /trunk/phase3/includes/PageHistory.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/PageHistory.php
@@ -331,16 +331,14 @@
332332 }
333333
334334 $tools = array();
 335+
335336 if( !is_null( $next ) && is_object( $next ) ) {
336 - # Add [rollback] link to current revision
337 - if( $latest && $this->mTitle->quickUserCan( 'rollback' ) &&
338 - $this->mTitle->quickUserCan( 'edit' ) )
339 - {
 337+ if( $latest && $this->mTitle->userCan( 'rollback' ) && $this->mTitle->userCan( 'edit' ) ) {
340338 $tools[] = '<span class="mw-rollback-link">'.$this->mSkin->buildRollbackLink( $rev ).'</span>';
341339 }
342 - # Add (undo) links to revisions
 340+
343341 if( $this->mTitle->quickUserCan( 'edit' ) && !$rev->isDeleted( Revision::DELETED_TEXT ) &&
344 - !($next->rev_deleted & Revision::DELETED_TEXT) )
 342+ !$next->rev_deleted & Revision::DELETED_TEXT )
345343 {
346344 # Create undo tooltip for the first (=latest) line only
347345 $undoTooltip = $latest

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r45166Use quickUserCan for UI linksaaron22:24, 29 December 2008

Status & tagging log