r81326 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81325‎ | r81326 | r81327 >
Date:21:54, 1 February 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Never show edit call to action on pages that the user can't edit.
Modified paths:
  • /trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js
@@ -248,6 +248,15 @@
249249 },
250250 'edit': {
251251 'condition': function() {
 252+ // An empty restrictions array means anyone can edit
 253+ if ( wgRestrictionEdit.length ) {
 254+ // Verify that each restriction exists in the user's groups
 255+ for ( var i = 0; i < wgRestrictionEdit.length; i++ ) {
 256+ if ( !$.inArray( wgRestrictionEdit[i], wgUserGroups ) ) {
 257+ return false;
 258+ }
 259+ }
 260+ }
252261 // If this pitch isn't muted, show this always
253262 return !isPitchMuted( 'edit' );
254263 },

Status & tagging log