Index: trunk/extensions/CodeReview/ApiCodeComments.php |
— | — | @@ -29,6 +29,11 @@ |
30 | 30 | } |
31 | 31 | |
32 | 32 | public function execute() { |
| 33 | + global $wgUser; |
| 34 | + // Before doing anything at all, let's check permissions |
| 35 | + if( !$wgUser->isAllowed('codereview-use') ) { |
| 36 | + $this->dieUsage('You don\'t have permission to view code comments','permissiondenied'); |
| 37 | + } |
33 | 38 | $params = $this->extractRequestParams(); |
34 | 39 | if ( is_null( $params['repo'] ) ) |
35 | 40 | $this->dieUsageMsg( array( 'missingparam', 'repo' ) ); |
Index: trunk/extensions/CodeReview/ApiCodeDiff.php |
— | — | @@ -3,6 +3,11 @@ |
4 | 4 | class ApiCodeDiff extends ApiBase { |
5 | 5 | |
6 | 6 | public function execute() { |
| 7 | + global $wgUser; |
| 8 | + // Before doing anything at all, let's check permissions |
| 9 | + if( !$wgUser->isAllowed('codereview-use') ) { |
| 10 | + $this->dieUsage('You don\'t have permission to view code diffs','permissiondenied'); |
| 11 | + } |
7 | 12 | $params = $this->extractRequestParams(); |
8 | 13 | |
9 | 14 | if ( !isset( $params['repo'] ) ) { |
Index: trunk/extensions/CodeReview/ApiCodeUpdate.php |
— | — | @@ -3,6 +3,11 @@ |
4 | 4 | class ApiCodeUpdate extends ApiBase { |
5 | 5 | |
6 | 6 | public function execute() { |
| 7 | + global $wgUser; |
| 8 | + // Before doing anything at all, let's check permissions |
| 9 | + if( !$wgUser->isAllowed('codereview-use') ) { |
| 10 | + $this->dieUsage('You don\'t have permission update code','permissiondenied'); |
| 11 | + } |
7 | 12 | $params = $this->extractRequestParams(); |
8 | 13 | |
9 | 14 | if ( !isset( $params['repo'] ) ) { |