r113060 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113059‎ | r113060 | r113061 >
Date:18:39, 5 March 2012
Author:kipcool
Status:deferred
Tags:
Comment:
added configurable permission to add/modify class attributes
Modified paths:
  • /trunk/extensions/Wikidata/App.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/OmegaWikiEditors.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/App.php
@@ -96,14 +96,20 @@
9797 $wgAvailableRights[] = 'wikidata-copy';
9898 $wgAvailableRights[] = 'languagenames';
9999 $wgAvailableRights[] = 'addcollection';
 100+$wgAvailableRights[] = 'editClassAttributes';
100101 $wgAvailableRights[] = 'exporttsv';
101102 $wgAvailableRights[] = 'importtsv';
 103+
 104+$wgGroupPermissions['*']['editClassAttributes'] = false;
 105+
102106 $wgGroupPermissions['wikidata-omega']['editwikidata-uw'] = true;
103107 $wgGroupPermissions['wikidata-omega']['deletewikidata-uw'] = true;
104108 $wgGroupPermissions['wikidata-copy']['wikidata-copy'] = true;
105109 $wgGroupPermissions['wikidata-omega']['wikidata-copy'] = true;
 110+
106111 $wgGroupPermissions['bureaucrat']['languagenames'] = true;
107112 $wgGroupPermissions['bureaucrat']['addcollection'] = true;
 113+$wgGroupPermissions['bureaucrat']['editClassAttributes'] = true;
108114 $wgGroupPermissions['bureaucrat']['exporttsv'] = true;
109115 $wgGroupPermissions['bureaucrat']['importtsv'] = true;
110116
@@ -150,13 +156,6 @@
151157 $wgDefinedMeaningPageTitlePrefix = '';
152158 $wgExpressionPageTitlePrefix = 'Multiple meanings';
153159
154 -// Hacks?
155 -$wgDefaultGoPrefix = 'Expression:';
156 -$wgDefaultClassMids = array( 402295 );
157 -
158 -require_once( $dir . 'OmegaWiki/GotoSourceTemplate.php' );
159 -$wgGotoSourceTemplates = array( 5 => $swissProtGotoSourceTemplate );
160 -
161160 # The site prefix allows us to have multiple sets of customized
162161 # messages (for different, typically site-specific UIs)
163162 # in a single database.
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiEditors.php
@@ -809,13 +809,12 @@
810810 function getDefinedMeaningEditor( ViewInformation $viewInformation ) {
811811 global
812812 $wdDefinedMeaningAttributesOrder, $definedMeaningMeaningName,
813 - $relationMeaningName;
 813+ $relationMeaningName, $wgUser;
814814
815815 $o = OmegaWikiAttributes::getInstance();
816816
817817 $definitionEditor = getDefinitionEditor( $viewInformation );
818818 $alternativeDefinitionsEditor = getAlternativeDefinitionsEditor( $viewInformation );
819 - $classAttributesEditor = getClassAttributesEditor( $viewInformation );
820819 $synonymsAndTranslationsEditor = getSynonymsAndTranslationsEditor( $viewInformation );
821820 $reciprocalRelationsEditor = getDefinedMeaningReciprocalRelationsEditor( $viewInformation );
822821 $classMembershipEditor = getDefinedMeaningClassMembershipEditor( $viewInformation );
@@ -824,7 +823,12 @@
825824 $availableEditors = new AttributeEditorMap();
826825 $availableEditors->addEditor( $definitionEditor );
827826 $availableEditors->addEditor( $alternativeDefinitionsEditor );
828 - $availableEditors->addEditor( $classAttributesEditor );
 827+
 828+ if ( $wgUser->isAllowed( 'editClassAttributes' ) ) {
 829+ $classAttributesEditor = getClassAttributesEditor( $viewInformation );
 830+ $availableEditors->addEditor( $classAttributesEditor );
 831+ }
 832+
829833 $availableEditors->addEditor( $synonymsAndTranslationsEditor );
830834 $availableEditors->addEditor( $reciprocalRelationsEditor );
831835 $availableEditors->addEditor( $classMembershipEditor );

Status & tagging log