r104828 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104827‎ | r104828 | r104829 >
Date:02:23, 1 December 2011
Author:aaron
Status:ok (Comments)
Tags:
Comment:
Adding block status checks to APIs (MFT of r104827)
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/MoodBar/ApiFeedbackDashboardResponse.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/MoodBar/ApiMoodBar.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/MoodBar/ApiFeedbackDashboardResponse.php
@@ -8,6 +8,9 @@
99 if ( $wgUser->isAnon() ) {
1010 $this->dieUsage( "You don't have permission to do that", 'permission-denied' );
1111 }
 12+ if ( $wgUser->isBlocked( false ) ) {
 13+ $this->dieUsageMsg( array( 'blockedtext' ) );
 14+ }
1215
1316 $params = $this->extractRequestParams();
1417
Index: branches/wmf/1.18wmf1/extensions/MoodBar/ApiMoodBar.php
@@ -2,6 +2,12 @@
33
44 class ApiMoodBar extends ApiBase {
55 public function execute() {
 6+ global $wgUser;
 7+
 8+ if ( $wgUser->isBlocked( false ) ) {
 9+ $this->dieUsageMsg( array( 'blockedtext' ) );
 10+ }
 11+
612 $params = $this->extractRequestParams();
713
814 $params['page'] = Title::newFromText( $params['page'] );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104827Added blockchecks to action=moodbar and action=feedbackdashboardresponseaaron02:13, 1 December 2011

Comments

#Comment by Nikerabbit (talk | contribs)   09:04, 2 December 2011

Can we somehow make a distinction between read and write actions and have the blockedness check for the later?

Status & tagging log