r45166 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45165‎ | r45166 | r45167 >
Date:22:24, 29 December 2008
Author:aaron
Status:reverted (Comments)
Tags:
Comment:
Use quickUserCan for UI links
Modified paths:
  • /trunk/phase3/includes/PageHistory.php (modified) (history)

Diff [purge]

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

Follow-up revisions

RevisionCommit summaryAuthorDate
r45255Revert r45166 "Use quickUserCan for UI links"...brion21:16, 31 December 2008

Comments

#Comment by Brion VIBBER (talk | contribs)   21:16, 31 December 2008

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.

Status & tagging log