v3.0.0+
Status: | effective |
Progress: | 100% |
Version: | 3.0.0+ |
There may be rare situations where a system administrator may want to remove the user groups "Administrator (Semantic Mediawiki)" (smwadministrator
) and/or "Curator (Semantic Mediawiki)" (smwcurator
) provided by Semantic MediaWiki from a wiki instance. In general doing this is neither necessary nor advisable.
In these situations the following code has to be added to the wiki's "LocalSetting.php" file preferably after the enableSemantics()
call:
- For Semantic MediaWiki ≥ 3.0.0
$GLOBALS['wgHooks']['SMW::Setup::AfterInitializationComplete'][] = function( &$vars ) {
if( array_key_exists( 'smwcurator', $vars['wgGroupPermissions'] ) ) {
unset( $vars['wgGroupPermissions']['smwcurator'] );
}
if( array_key_exists( 'smwadministrator', $vars['wgGroupPermissions'] ) ) {
unset( $vars['wgGroupPermissions']['smwadministrator'] );
}
};
- For Semantic MediaWiki < 3.0.0
$GLOBALS['wgExtensionFunctions'][] = function() {
if( array_key_exists( 'smwcurator', $GLOBALS['wgGroupPermissions'] ) ) {
unset( $GLOBALS['wgGroupPermissions']['smwcurator'] );
}
if( array_key_exists( 'smwadministrator', $GLOBALS['wgGroupPermissions'] ) ) {
unset( $GLOBALS['wgGroupPermissions']['smwadministrator'] );
}
};