0

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;
3
  • Could you explain what do you want to happen and what's actually happening?
    – svick
    May 10, 2012 at 14:57
  • Actually, pages into the namespace "Staff" are visible for everyone but editable just by the Staff group. Is it possible to block the access of staff pages for simple users ? Or need I an extension ?
    – C0b0ll
    May 11, 2012 at 6:46
  • I think this should be migrated to ServerFault. May 11, 2012 at 8:30

2 Answers 2

1

Try Extension:Lockdown, however be advised that MediaWiki architecturally does not guarantee 100% secure partial read restrictions.

0
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.