r78170 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78169‎ | r78170 | r78171 >
Date:10:55, 10 December 2010
Author:catrope
Status:ok (Comments)
Tags:
Comment:
Fix regression in r78117 per CR, was causing read, edit and history tabs to disappear for users who couldn't edit due to $wgEmailConfirmToEdit or $wgNamespaceProtection
Modified paths:
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/skins/Vector.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/Vector.php
@@ -73,7 +73,7 @@
7474 $action = $wgRequest->getVal( 'action', 'view' );
7575 $section = $wgRequest->getVal( 'section' );
7676
77 - $userCanRead = $this->mTitle->quickUserCan( 'read' );
 77+ $userCanRead = $this->mTitle->userCanRead();
7878
7979 // Checks if page is some kind of content
8080 if( $this->iscontent ) {
Index: trunk/phase3/includes/SkinTemplate.php
@@ -728,7 +728,7 @@
729729 $action = $wgRequest->getVal( 'action', 'view' );
730730 $section = $wgRequest->getVal( 'section' );
731731 $content_actions = array();
732 - $userCanRead = $this->mTitle->quickUserCan( 'read' );
 732+ $userCanRead = $this->mTitle->userCanRead();
733733
734734 $prevent_active_tabs = false;
735735 wfRunHooks( 'SkinTemplatePreventOtherActiveTabs', array( &$this, &$prevent_active_tabs ) );

Follow-up revisions

RevisionCommit summaryAuthorDate
r79129MFT r78011 r78014 r78015 r78016 r78099 r78117 r78161 r78170 r78172 r78199 r78......platonides19:58, 28 December 2010
r79341Follow-up r79340: merge r78117, r78170, r78172 and r78506 from trunk into ski...catrope15:48, 31 December 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r78117Do not reveal page existence in colour of links in tabs when a user cannot re...werdna04:54, 9 December 2010

Comments

#Comment by Platonides (talk | contribs)   22:40, 29 December 2010

A quickUserCan( 'read' ); shouldn't fail if you can't edit. At least, it should translate it into a call userCanRead(); behind the scenes.

#Comment by Catrope (talk | contribs)   22:56, 29 December 2010

The point is that quickUserCan('read') and userCanRead() do differ, that's the very cause of this bug.

#Comment by 😂 (talk | contribs)   22:57, 29 December 2010

We *really* need to cleanup/harmonize/document permission checks.

#Comment by Platonides (talk | contribs)   13:40, 30 December 2010

Is there any reason not to consider it a bug?

quickUserCan('read'), being quick, could return true while it should return false. But returning false when in fact you can read it...

Status & tagging log