Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -41,6 +41,7 @@ |
42 | 42 | $wgAutoloadClasses['ApiCodeDiff'] = $dir . 'api/ApiCodeDiff.php'; |
43 | 43 | $wgAutoloadClasses['ApiQueryCodeComments'] = $dir . 'api/ApiQueryCodeComments.php'; |
44 | 44 | $wgAutoloadClasses['ApiQueryCodeRevisions'] = $dir . 'api/ApiQueryCodeRevisions.php'; |
| 45 | +$wgAutoloadClasses['CodeRevisionCommitterApi'] = $dir . 'api/CodeRevisionCommitterApi.php'; |
45 | 46 | |
46 | 47 | $wgAutoloadClasses['SubversionAdaptor'] = $dir . 'backend/Subversion.php'; |
47 | 48 | $wgAutoloadClasses['CodeDiffHighlighter'] = $dir . 'backend/DiffHighlighter.php'; |
Index: trunk/extensions/CodeReview/api/CodeRevisionCommitterApi.php |
— | — | @@ -0,0 +1,18 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Variation of CodeRevisionCommiter for use in the API. Removes the post and token checking from validPost |
| 6 | + * API can/will do the POST checking (and token?) |
| 7 | + */ |
| 8 | +class CodeRevisionCommitterApi extends CodeRevisionCommitter { |
| 9 | + /** |
| 10 | + * Check whether the user has the correct permissions for the action |
| 11 | + * |
| 12 | + * @param String $permission |
| 13 | + * @return bool |
| 14 | + */ |
| 15 | + function validPost( $permission ) { |
| 16 | + global $wgUser; |
| 17 | + return $wgUser->isAllowed( $permission ); |
| 18 | + } |
| 19 | +} |
Property changes on: trunk/extensions/CodeReview/api/CodeRevisionCommitterApi.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 20 | + native |