Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js |
— | — | @@ -248,6 +248,15 @@ |
249 | 249 | }, |
250 | 250 | 'edit': { |
251 | 251 | '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 | + } |
252 | 261 | // If this pitch isn't muted, show this always |
253 | 262 | return !isPitchMuted( 'edit' ); |
254 | 263 | }, |