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.
}
$tools = array();
+
if( !is_null( $next ) && is_object( $next ) ) {
- # Add [rollback] link to current revision
- if( $latest && $this->mTitle->quickUserCan( 'rollback' ) &&
- $this->mTitle->quickUserCan( 'edit' ) )
- {
+ if( $latest && $this->mTitle->userCan( 'rollback' ) && $this->mTitle->userCan( 'edit' ) ) {
$tools[] = '<span class="mw-rollback-link">'.$this->mSkin->buildRollbackLink( $rev ).'</span>';
}
- # Add (undo) links to revisions
+
if( $this->mTitle->quickUserCan( 'edit' ) && !$rev->isDeleted( Revision::DELETED_TEXT ) &&
- !($next->rev_deleted & Revision::DELETED_TEXT) )
+ !$next->rev_deleted & Revision::DELETED_TEXT )
{
# Create undo tooltip for the first (=latest) line only
$undoTooltip = $latest