r76912 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76911‎ | r76912 | r76913 >
Date:22:45, 17 November 2010
Author:reedy
Status:ok
Tags:
Comment:
More for bug 25940 (Add API module(s) to add comments/set revision status)

Create a subclass of CodeRevisionCommitter for the API usage, overriding functionality of validPost
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.php (modified) (history)
  • /trunk/extensions/CodeReview/api/CodeRevisionCommitterApi.php (added) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.php
@@ -41,6 +41,7 @@
4242 $wgAutoloadClasses['ApiCodeDiff'] = $dir . 'api/ApiCodeDiff.php';
4343 $wgAutoloadClasses['ApiQueryCodeComments'] = $dir . 'api/ApiQueryCodeComments.php';
4444 $wgAutoloadClasses['ApiQueryCodeRevisions'] = $dir . 'api/ApiQueryCodeRevisions.php';
 45+$wgAutoloadClasses['CodeRevisionCommitterApi'] = $dir . 'api/CodeRevisionCommitterApi.php';
4546
4647 $wgAutoloadClasses['SubversionAdaptor'] = $dir . 'backend/Subversion.php';
4748 $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
120 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r76922bug 25940 Add API module(s) to add comments/set revision status...reedy00:00, 18 November 2010
r76930bug 25940 Add API module(s) to add comments/set revision status...reedy00:42, 18 November 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76905Prequisite to bug 25940 (Add API module(s) to add comments/set revision status)...reedy21:01, 17 November 2010

Status & tagging log