Index: trunk/extensions/CodeReview/SpecialCode.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | |
5 | 5 | class SpecialCode extends SpecialPage { |
6 | 6 | function __construct() { |
7 | | - parent::__construct( 'Code' ); |
| 7 | + parent::__construct( 'Code' , 'codereview-use' ); |
8 | 8 | } |
9 | 9 | |
10 | 10 | function execute( $subpage ) { |
— | — | @@ -11,6 +11,11 @@ |
12 | 12 | |
13 | 13 | wfLoadExtensionMessages( 'CodeReview' ); |
14 | 14 | |
| 15 | + if( !$this->userCanExecute( $wgUser ) ) { |
| 16 | + $this->displayRestrictionError(); |
| 17 | + return; |
| 18 | + } |
| 19 | + |
15 | 20 | $this->setHeaders(); |
16 | 21 | $wgOut->addStyle( "$wgScriptPath/extensions/CodeReview/codereview.css?$wgCodeReviewStyleVersion" ); |
17 | 22 | # Remove stray slashes |
Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -77,12 +77,15 @@ |
78 | 78 | $wgExtensionAliasesFiles['CodeReview'] = $dir . 'CodeReview.alias.php'; |
79 | 79 | |
80 | 80 | $wgAvailableRights[] = 'repoadmin'; |
| 81 | +$wgAvailableRights[] = 'codereview-use'; |
81 | 82 | $wgAvailableRights[] = 'codereview-add-tag'; |
82 | 83 | $wgAvailableRights[] = 'codereview-remove-tag'; |
83 | 84 | $wgAvailableRights[] = 'codereview-post-comment'; |
84 | 85 | $wgAvailableRights[] = 'codereview-set-status'; |
85 | 86 | $wgAvailableRights[] = 'codereview-link-user'; |
86 | 87 | |
| 88 | +$wgGroupPermissions['*']['codereview-use'] = true; |
| 89 | + |
87 | 90 | $wgGroupPermissions['user']['codereview-add-tag'] = true; |
88 | 91 | $wgGroupPermissions['user']['codereview-remove-tag'] = true; |
89 | 92 | $wgGroupPermissions['user']['codereview-post-comment'] = true; |