r25147 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25146‎ | r25147 | r25148 >
Date:21:51, 25 August 2007
Author:kim
Status:old
Tags:
Comment:
Made a new copy group/permission, so you can give copy permission
on a fine grained basis.
Modified paths:
  • /trunk/extensions/Wikidata/App.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/DefinedMeaning.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/App.php
@@ -37,6 +37,7 @@
3838 $wgGroupPermissions['wikidata-omega']['editwikidata-moo']=true;
3939 $wgGroupPermissions['wikidata-omega']['editwikidata-tt']=false;
4040 $wgGroupPermissions['wikidata-test']['editwikidata-tt']=true;
 41+$wgGroupPermissions['wikidata-copy']['wikidata-copy']=true;
4142
4243 require_once("{$IP}/extensions/Wikidata/AddPrefs.php");
4344 require_once("{$IP}/extensions/Wikidata/SpecialLanguages.php");
Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaning.php
@@ -221,14 +221,21 @@
222222 return $html;
223223 }
224224
225 - /**
226 - * @returns user interface html for copying Defined Meanings between
227 - datasets
 225+ /** @returns user interface html for copying Defined Meanings
 226+ * between datasets. returns an empty string if the user
 227+ * actually doesn't have permission to edit.
228228 */
229229 protected function getCopyPanel() {
230230
231231 # mostly same code as in SpecialAddCollection... possibly might
232232 # make a nice separate function
 233+
 234+ global
 235+ $wgUser;
 236+ if(!$wgUser->isAllowed('wikidata-copy')) {
 237+ return "";
 238+ }
 239+
233240 $datasets=wdGetDatasets();
234241 $datasetarray['']=wfMsgSc('ow_none_selected');
235242 foreach($datasets as $datasetid=>$dataset) {
Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php
@@ -231,9 +231,17 @@
232232 * FIXME - work in progress
233233 */
234234 public function saveWithinTransaction() {
235 - #global
236 - # $wgTitle, $wgUser, $wgRequest;
 235+# global
 236+# $wgTitle, $wgUser, $wgRequest;
237237
 238+ global
 239+ $wgUser;
 240+
 241+ if(!$wgUser->isAllowed('wikidata-copy')) {
 242+ $wgOut->addWikiText(wfMsgSc("noedit",$dc->fetchName()));
 243+ $wgOut->setPageTitle(wfMsgSc("noedit_title"));
 244+ return false;
 245+ }
238246 #$summary = $wgRequest->getText('summary');
239247
240248

Status & tagging log