r85668 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85667‎ | r85668 | r85669 >
Date:09:34, 8 April 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
* (bug 28462) Allow only specific users to review their own revisions


Applied patch by Simon Walker

Coding style tweaks, added QQQ for new right

Not included setting svnadmins to be allowed to mark their own revs as ok. End users can set this up if/how they requires
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.i18n.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeReview.php (modified) (history)
  • /trunk/extensions/CodeReview/backend/CodeRevision.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.php
@@ -102,6 +102,7 @@
103103 $wgAvailableRights[] = 'codereview-signoff';
104104 $wgAvailableRights[] = 'codereview-associate';
105105 $wgAvailableRights[] = 'codereview-link-user';
 106+$wgAvailableRights[] = 'codereview-review-own';
106107
107108 $wgGroupPermissions['*']['codereview-use'] = true;
108109
Index: trunk/extensions/CodeReview/backend/CodeRevision.php
@@ -265,7 +265,10 @@
266266 // Obviously only works if user accounts are tied!
267267 $wikiUser = $this->getWikiUser();
268268 if ( $status == 'ok' && $wikiUser && $user->getName() == $wikiUser->getName() ) {
269 - return false;
 269+ // allow the user to review their own code if required
 270+ if ( !$wikiUser->isAllowed( 'codereview-review-own' ) ) {
 271+ return false;
 272+ }
270273 }
271274
272275 // Get the old status from the master
Index: trunk/extensions/CodeReview/CodeReview.i18n.php
@@ -224,6 +224,7 @@
225225 'right-codereview-signoff' => 'Sign off on revisions',
226226 'right-codereview-link-user' => 'Link authors to wiki users',
227227 'right-codereview-associate' => 'Manage revision associations',
 228+ 'right-codereview-review-own' => 'Mark your own revisions as OK',
228229
229230 'specialpages-group-developer' => 'Developer tools',
230231
@@ -353,8 +354,9 @@
354355 'right-codereview-post-comment' => '{{doc-right}}',
355356 'right-codereview-set-status' => '{{doc-right}}',
356357 'right-codereview-signoff' => 'A "sign-off" is a concept in code review that means that the person doing the sign-off has approved the involved code changes.',
357 - 'right-codereview-link-user' => '{{Doc-right}}',
 358+ 'right-codereview-link-user' => '{{doc-right}}',
358359 'right-codereview-associate' => '{{doc-right|codereview-associate}}',
 360+ 'right-right-codereview-review-own' => '{{doc-right}}',
359361 );
360362
361363 /** Afrikaans (Afrikaans)

Comments

#Comment by Reach Out to the Truth (talk | contribs)   13:50, 8 April 2011

"Mark your own revisions as OK" shouldn't include the second person pronoun "your".

#Comment by Reedy (talk | contribs)   14:47, 8 April 2011

So 'Mark own revisions as OK' ?

#Comment by Bryan (talk | contribs)   20:20, 8 April 2011

Shouldn't this also check for resolved?

#Comment by Reedy (talk | contribs)   20:43, 8 April 2011

Best ask the guy that wanted it... WMF won't be using it I'd guess....

Status & tagging log