r62525 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62524‎ | r62525 | r62526 >
Date:16:42, 15 February 2010
Author:jeroendedauw
Status:ok
Tags:
Comment:
Changes name of permission and added permission check on storyreview special page
Modified paths:
  • /trunk/extensions/Storyboard/Storyboard.i18n.php (modified) (history)
  • /trunk/extensions/Storyboard/Storyboard.php (modified) (history)
  • /trunk/extensions/Storyboard/specials/StoryReview_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/specials/StoryReview_body.php
@@ -14,14 +14,25 @@
1515
1616 class SpecialStoryReview extends IncludableSpecialPage {
1717
18 - function __construct() {
 18+ public function __construct() {
1919 parent::__construct( 'StoryReview' );
2020
2121 wfLoadExtensionMessages( 'Storyboard' );
2222 }
2323
24 - function execute( $language ) {
 24+ public function execute( $language ) {
 25+ global $wgUser;
 26+ if ($wgUser->isAllowed('storyreview') && !$wgUser->isBlocked()) {
 27+ $this->addOutput();
 28+ }
 29+ else {
 30+ global $wgOut;
 31+ $wgOut->permissionRequired( 'storyreview' );
 32+ }
 33+ }
 34+
 35+ private function addOutput() {
2536 global $wgOut;
26 - $wgOut->includeJQuery();
 37+ $wgOut->includeJQuery();
2738 }
2839 }
Index: trunk/extensions/Storyboard/Storyboard.i18n.php
@@ -17,7 +17,7 @@
1818 // General
1919 'storyboard-name' => 'Storyboard',
2020 'storyboard-desc' => 'Provides a landing page for donors, a page where stories can be submitted, and a story moderation interface',
21 - 'right-storyboard' => 'Review, edit, publish, and hide stories',
 21+ 'right-storyreview' => 'Review, edit, publish, and hide stories',
2222 );
2323
2424 /** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца))
Index: trunk/extensions/Storyboard/Storyboard.php
@@ -64,12 +64,8 @@
6565 *
6666 * By default, only sysops will be able to do this.
6767 */
68 -$wgGroupPermissions['*' ]['storyboard'] = false;
69 -$wgGroupPermissions['user' ]['storyboard'] = false;
70 -$wgGroupPermissions['autoconfirmed']['storyboard'] = false;
71 -$wgGroupPermissions['bot' ]['storyboard'] = false;
72 -$wgGroupPermissions['sysop' ]['storyboard'] = true;
73 -$wgAvailableRights[] = 'storyboard';
 68+$wgAvailableRights[] = 'storyreview';
 69+$wgGroupPermissions['sysop' ]['storyreview'] = true;
7470
7571 /**
7672 * Initialization function for the Storyboard extension.

Follow-up revisions

RevisionCommit summaryAuthorDate
r62529Storyboard: Whitespace fixes for r62525catrope17:29, 15 February 2010

Status & tagging log