问题
I try to create some permissions on my MediaWiki. I followed this tutorial, but it didn't work...
I try to create a Staff group which have permission to read, edit, create and delete pages into the Staff namespace. Classic users should not see all pages in this namespace.
Here is the LocalSettings.php file :
# Namespaces
define('NS_STAFF', 103);
$wgExtraNamespaces[NS_STAFF] = 'Staff';
# Groups
define('G_STAFF', 'Staff');
# Default Group Rights
# Anonyms
$wgGroupPermissions['*']['read'] = true;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['create'] = false;
# User
$wgGroupPermissions['user']['read'] = true;
$wgGroupPermissions['user']['edit'] = false;
$wgGroupPermissions['user']['create'] = false;
# Staff
$wgGroupPermissions[G_STAFF]['read'] = true;
$wgGroupPermissions[G_STAFF]['edit'] = true;
$wgGroupPermissions[G_STAFF]['create'] = true;
# Groups Rights
$wgNamespaceProtection[NS_STAFF] = array(G_STAFF);
Could explain me what i'm doing wrong ?
UPDATE
I upgraded my Mediawiki to version 1.19.0. The pages into the namespace "Staff" are still visible for the user group but not editable.
How to block the access to pages into a specific namespace ?
Here is the LocalSettings.php file :
#Groups
define('G_PROGRAMMER', 'Programmer');
define('G_ADMIN_SYSTEM', 'AdminSystem');
define('G_DESIGNER', 'Designer');
define('G_STAFF', 'Staff');
# Default Group Rights
# Anonyms
$wgGroupPermissions['*']['read'] = true;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['create'] = false;
# User
$wgGroupPermissions['user']['read'] = true;
$wgGroupPermissions['user']['edit'] = false;
$wgGroupPermissions['user']['create'] = false;
# Staff
$wgGroupPermissions[G_STAFF]['read'] = true;
$wgGroupPermissions[G_STAFF]['edit'] = true;
$wgGroupPermissions[G_STAFF]['create'] = true;
# Groups Rights
$wgNamespaceProtection[NS_STAFF] = array('staff-edit');
$wgGroupPermissions[G_STAFF]['staff-edit'] = true;
回答1:
Try Extension:Lockdown, however be advised that MediaWiki architecturally does not guarantee 100% secure partial read restrictions.
回答2:
Indeed, the $wgNamespaceProtection allows to prevent editing (and only editing) of a custom namespace (see documentation about $wgNamespaceProtection).
To prevent reading of a custom namespace an extension is needed.
I'll try Lockdown.
来源:https://stackoverflow.com/questions/10535524/mediawiki-1-18-3-1-19-0-namespaces-restrictions