r48538 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48537‎ | r48538 | r48539 >
Date:21:14, 18 March 2009
Author:aaron
Status:ok (Comments)
Tags:
Comment:
(bug 17984) Allow restriction of access to Special:Code
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.php (modified) (history)
  • /trunk/extensions/CodeReview/SpecialCode.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/SpecialCode.php
@@ -3,7 +3,7 @@
44
55 class SpecialCode extends SpecialPage {
66 function __construct() {
7 - parent::__construct( 'Code' );
 7+ parent::__construct( 'Code' , 'codereview-use' );
88 }
99
1010 function execute( $subpage ) {
@@ -11,6 +11,11 @@
1212
1313 wfLoadExtensionMessages( 'CodeReview' );
1414
 15+ if( !$this->userCanExecute( $wgUser ) ) {
 16+ $this->displayRestrictionError();
 17+ return;
 18+ }
 19+
1520 $this->setHeaders();
1621 $wgOut->addStyle( "$wgScriptPath/extensions/CodeReview/codereview.css?$wgCodeReviewStyleVersion" );
1722 # Remove stray slashes
Index: trunk/extensions/CodeReview/CodeReview.php
@@ -77,12 +77,15 @@
7878 $wgExtensionAliasesFiles['CodeReview'] = $dir . 'CodeReview.alias.php';
7979
8080 $wgAvailableRights[] = 'repoadmin';
 81+$wgAvailableRights[] = 'codereview-use';
8182 $wgAvailableRights[] = 'codereview-add-tag';
8283 $wgAvailableRights[] = 'codereview-remove-tag';
8384 $wgAvailableRights[] = 'codereview-post-comment';
8485 $wgAvailableRights[] = 'codereview-set-status';
8586 $wgAvailableRights[] = 'codereview-link-user';
8687
 88+$wgGroupPermissions['*']['codereview-use'] = true;
 89+
8790 $wgGroupPermissions['user']['codereview-add-tag'] = true;
8891 $wgGroupPermissions['user']['codereview-remove-tag'] = true;
8992 $wgGroupPermissions['user']['codereview-post-comment'] = true;

Follow-up revisions

RevisionCommit summaryAuthorDate
r48575Follow up r48538: Add a description message for the new user rightraymond07:16, 19 March 2009
r48777Follow up to r48538: check permissions for apiaaron01:26, 25 March 2009

Comments

#Comment by Raymond (talk | contribs)   07:17, 19 March 2009

Description message for the new user right added in r48575.

#Comment by Voice of All (talk | contribs)   01:27, 25 March 2009

Added to API in r48777

Status & tagging log