Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
CodeRevisionCommitterApi | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
validPost | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\CodeReview\Api; |
4 | |
5 | use MediaWiki\Extension\CodeReview\UI\CodeRevisionCommitter; |
6 | use MediaWiki\Permissions\Authority; |
7 | |
8 | /** |
9 | * Variation of CodeRevisionCommiter for use in the API. Removes the post and token checking from |
10 | * validPost API can/will do both the POST and token |
11 | */ |
12 | class CodeRevisionCommitterApi extends CodeRevisionCommitter { |
13 | /** |
14 | * Check whether the user has the correct permissions for the action |
15 | * |
16 | * @param string $permission |
17 | * @param Authority $performer |
18 | * @return bool |
19 | */ |
20 | public function validPost( $permission, Authority $performer ) { |
21 | return $performer->isAllowed( $permission ); |
22 | } |
23 | } |