Index: trunk/extensions/Wikidata/App.php |
— | — | @@ -37,6 +37,7 @@ |
38 | 38 | $wgGroupPermissions['wikidata-omega']['editwikidata-moo']=true; |
39 | 39 | $wgGroupPermissions['wikidata-omega']['editwikidata-tt']=false; |
40 | 40 | $wgGroupPermissions['wikidata-test']['editwikidata-tt']=true; |
| 41 | +$wgGroupPermissions['wikidata-copy']['wikidata-copy']=true; |
41 | 42 | |
42 | 43 | require_once("{$IP}/extensions/Wikidata/AddPrefs.php"); |
43 | 44 | require_once("{$IP}/extensions/Wikidata/SpecialLanguages.php"); |
Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaning.php |
— | — | @@ -221,14 +221,21 @@ |
222 | 222 | return $html; |
223 | 223 | } |
224 | 224 | |
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. |
228 | 228 | */ |
229 | 229 | protected function getCopyPanel() { |
230 | 230 | |
231 | 231 | # mostly same code as in SpecialAddCollection... possibly might |
232 | 232 | # make a nice separate function |
| 233 | + |
| 234 | + global |
| 235 | + $wgUser; |
| 236 | + if(!$wgUser->isAllowed('wikidata-copy')) { |
| 237 | + return ""; |
| 238 | + } |
| 239 | + |
233 | 240 | $datasets=wdGetDatasets(); |
234 | 241 | $datasetarray['']=wfMsgSc('ow_none_selected'); |
235 | 242 | foreach($datasets as $datasetid=>$dataset) { |
Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php |
— | — | @@ -231,9 +231,17 @@ |
232 | 232 | * FIXME - work in progress |
233 | 233 | */ |
234 | 234 | public function saveWithinTransaction() { |
235 | | - #global |
236 | | - # $wgTitle, $wgUser, $wgRequest; |
| 235 | +# global |
| 236 | +# $wgTitle, $wgUser, $wgRequest; |
237 | 237 | |
| 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 | + } |
238 | 246 | #$summary = $wgRequest->getText('summary'); |
239 | 247 | |
240 | 248 | |