https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113060
Revision: 113060 Author: kipcool Date: 2012-03-05 18:39:31 +0000 (Mon, 05 Mar 2012) Log Message: ----------- added configurable permission to add/modify class attributes Modified Paths: -------------- trunk/extensions/Wikidata/App.php trunk/extensions/Wikidata/OmegaWiki/OmegaWikiEditors.php Modified: trunk/extensions/Wikidata/App.php =================================================================== --- trunk/extensions/Wikidata/App.php 2012-03-05 18:18:48 UTC (rev 113059) +++ trunk/extensions/Wikidata/App.php 2012-03-05 18:39:31 UTC (rev 113060) @@ -96,14 +96,20 @@ $wgAvailableRights[] = 'wikidata-copy'; $wgAvailableRights[] = 'languagenames'; $wgAvailableRights[] = 'addcollection'; +$wgAvailableRights[] = 'editClassAttributes'; $wgAvailableRights[] = 'exporttsv'; $wgAvailableRights[] = 'importtsv'; + +$wgGroupPermissions['*']['editClassAttributes'] = false; + $wgGroupPermissions['wikidata-omega']['editwikidata-uw'] = true; $wgGroupPermissions['wikidata-omega']['deletewikidata-uw'] = true; $wgGroupPermissions['wikidata-copy']['wikidata-copy'] = true; $wgGroupPermissions['wikidata-omega']['wikidata-copy'] = true; + $wgGroupPermissions['bureaucrat']['languagenames'] = true; $wgGroupPermissions['bureaucrat']['addcollection'] = true; +$wgGroupPermissions['bureaucrat']['editClassAttributes'] = true; $wgGroupPermissions['bureaucrat']['exporttsv'] = true; $wgGroupPermissions['bureaucrat']['importtsv'] = true; @@ -150,13 +156,6 @@ $wgDefinedMeaningPageTitlePrefix = ''; $wgExpressionPageTitlePrefix = 'Multiple meanings'; -// Hacks? -$wgDefaultGoPrefix = 'Expression:'; -$wgDefaultClassMids = array( 402295 ); - -require_once( $dir . 'OmegaWiki/GotoSourceTemplate.php' ); -$wgGotoSourceTemplates = array( 5 => $swissProtGotoSourceTemplate ); - # The site prefix allows us to have multiple sets of customized # messages (for different, typically site-specific UIs) # in a single database. Modified: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiEditors.php =================================================================== --- trunk/extensions/Wikidata/OmegaWiki/OmegaWikiEditors.php 2012-03-05 18:18:48 UTC (rev 113059) +++ trunk/extensions/Wikidata/OmegaWiki/OmegaWikiEditors.php 2012-03-05 18:39:31 UTC (rev 113060) @@ -809,13 +809,12 @@ function getDefinedMeaningEditor( ViewInformation $viewInformation ) { global $wdDefinedMeaningAttributesOrder, $definedMeaningMeaningName, - $relationMeaningName; + $relationMeaningName, $wgUser; $o = OmegaWikiAttributes::getInstance(); $definitionEditor = getDefinitionEditor( $viewInformation ); $alternativeDefinitionsEditor = getAlternativeDefinitionsEditor( $viewInformation ); - $classAttributesEditor = getClassAttributesEditor( $viewInformation ); $synonymsAndTranslationsEditor = getSynonymsAndTranslationsEditor( $viewInformation ); $reciprocalRelationsEditor = getDefinedMeaningReciprocalRelationsEditor( $viewInformation ); $classMembershipEditor = getDefinedMeaningClassMembershipEditor( $viewInformation ); @@ -824,7 +823,12 @@ $availableEditors = new AttributeEditorMap(); $availableEditors->addEditor( $definitionEditor ); $availableEditors->addEditor( $alternativeDefinitionsEditor ); - $availableEditors->addEditor( $classAttributesEditor ); + + if ( $wgUser->isAllowed( 'editClassAttributes' ) ) { + $classAttributesEditor = getClassAttributesEditor( $viewInformation ); + $availableEditors->addEditor( $classAttributesEditor ); + } + $availableEditors->addEditor( $synonymsAndTranslationsEditor ); $availableEditors->addEditor( $reciprocalRelationsEditor ); $availableEditors->addEditor( $classMembershipEditor ); _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs