Just for information, here is what I have for my namespace in
LocalSettings.php :
$wgExtraNamespaces = array( 100 => "PRIVATE" );
$wgNamespacesWithSubpages = array(
100 => true,
);
$wgGroupPermissions['*']['ns100_read'] = false;
$wgGroupPermissions['*']['ns100_edit'] = false;
$wgGroupPermissions['*']['ns100_create'] = false;
$wgGroupPermissions['*']['ns100_move'] = false;
$wgGroupPermissions['sysop']['ns100_read'] = true;
$wgGroupPermissions['sysop']['ns100_edit'] = true;
$wgGroupPermissions['sysop']['ns100_create'] = true;
$wgGroupPermissions['sysop']['ns100_move'] = true;
require('extensions/NamespacePermissions.php');
And now, here is the listening of NamespacePermissions.php :
<?php
/* NamespacePermissions - MediaWiki extension
*
* provides separate permissions for each action (read,edit,create,move)
* on articles in custom namespaces for fine access management
*
* Author: Petr Andreev
*
* Sample usage:
*
* $wgExtraNamespaces = array(100 => "Foo", 101 => "Foo_Talk");
* // optional (example): allow registered users to view and edit
articles in Foo
* $wgGroupPermissions[ 'user' ][ 'ns100_read' ] = true;
* $wgGroupPermissions[ 'user' ][ 'ns100_edit' ] = true;
* // end of optional
* require('extensions/NamespacePermissions.php');
*
* Permissions provided:
* # ns{$num}_read
* # ns{$num}_edit
* # ns{$num}_create
* # ns{$num}_move
* where {$num} - namespace number (e.g. ns100_read, ns101_create)
*
* Groups provided:
* # ns{$title}RW - full access to the namespace {$title}
* # ns{$title}RO - read-only access to the namespace {$title}
* e.g. nsFoo_talkRW, nsFooRO
*/
// permissions for autocreated groups should be set now,
// before the User object for current user is instantiated
namespacePermissionsCreateGroups();
// other stuff should better be done via standard mechanism of
running extensions
$wgExtensionFunctions[] = "wfNamespacePermissions";
// create groups for each custom namespace
function namespacePermissionsCreateGroups() {
global $wgExtraNamespaces, $wgGroupPermissions;
foreach ( $wgExtraNamespaces as $num => $title ) {
$wgGroupPermissions[ "ns{$title}RW" ][ "ns{$num}_edit" ] =
true;
$wgGroupPermissions[ "ns{$title}RW" ][ "ns{$num}_read" ] =
true;
$wgGroupPermissions[ "ns{$title}RW" ][ "ns{$num}_create" ] =
true;
$wgGroupPermissions[ "ns{$title}RW" ][ "ns{$num}_move" ] =
true;
$wgGroupPermissions[ "ns{$title}RO" ][ "ns{$num}_read" ] =
true;
}
}
function wfNamespacePermissions() {
global $wgHooks;
// use the userCan hook to check permissions
$wgHooks[ 'userCan' ][] = 'namespacePermissionsCheckNamespace';
}
function namespacePermissionsCheckNamespace( $title, $user, $action,
$result ) {
if ( ( $ns = $title->getNamespace() ) >= 100 ) {
if ( ! $user->isAllowed("ns{$ns}_{$action}") ) {
$result = false;
return false;
}
}
return null;
}
?>
This work perfectly for me with MediaWiki 1.7.1 ...
Le 23 oct. 06 à 09:04, Mauro do Carmo a écrit :
Opz... Klint,
Ive installed now the extention and that is what I have:
#############################################################
Creating a new namespace
$wgExtraNamespaces[100] = "Nexus";
$wgExtraNamespaces[101] = "Nexus_talk";
######################################## Block anonimous edits
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['createaccount'] = false;
######################################## Allowding anonimous edits
for nsNexus
$wgGroupPermissions['*']['ns100_read'] = true;
$wgGroupPermissions['*']['ns100_edit'] = true;
$wgGroupPermissions['*']['ns100_create'] = true;
$wgGroupPermissions['*']['ns100_move'] = false;
$wgGroupPermissions['sysop']['ns100_read'] = true;
$wgGroupPermissions['sysop']['ns100_edit'] = true;
$wgGroupPermissions['sysop']['ns100_create'] = true;
$wgGroupPermissions['sysop']['ns100_move'] = true;
But still I am not able to edit 'Nexus:'...
Thanks a lot, mauro.
|-----Original Message-----
|From: mediawiki-l-bounces(a)Wikimedia.org [mailto:mediawiki-l-
bounces(a)Wikimedia.org] On Behalf Of Mauro
|do Carmo
|Sent: Sunday, October 22, 2006 11:42 PM
|To: 'MediaWiki announcements and site admin list'
|Subject: Re: [Mediawiki-l] Twiki or Wiki???
|
|Thanks Klint,
|
|But I am still have some problems:
|
|I created this new namespace called 'Nexus'
|#############################################################
Creating a new namespace
|$wgExtraNamespaces[100] = "Nexus";
|$wgExtraNamespaces[101] = "Nexus_talk";
|
|Here I am blocking anonymous edits
|######################################## Block anonimous edits
|$wgGroupPermissions['*']['edit'] = false;
|$wgGroupPermissions['*']['createaccount'] = false;
|
|And here, I want anonymous to be able edit just the namespace 'Nexus'
|######################################## Allowding anonimous edits
for nsNexus
|$wgGroupPermissions['*']['nsNexus_read'] = true;
|$wgGroupPermissions['*']['nsNexus_edit'] = true;
|$wgGroupPermissions['*']['nsNexus_create'] = false;
|$wgGroupPermissions['*']['nsNexus_move'] = false;
|$wgGroupPermissions['sysop']['nsNexus_read'] = true;
|$wgGroupPermissions['sysop']['nsNexus_edit'] = true;
|$wgGroupPermissions['sysop']['nsNexus_create'] = true;
|$wgGroupPermissions['sysop']['nsNexus_move'] = true;
|
|That configuration is not working...
|
|Someone have any clue... thanks... mauro.
|
|
||-----Original Message-----
||Hi Mauro,
||
||Just set the correct right to the user group in LocalSetting.php
||
||For example, I did this on the namespace number 100 to protect it
||from reading/editing/ ... Only accessible by SYSOPs ...
||
||$wgGroupPermissions['*']['ns100_read'] = false;
||$wgGroupPermissions['*']['ns100_edit'] = false;
||$wgGroupPermissions['*']['ns100_create'] = false;
||$wgGroupPermissions['*']['ns100_move'] = false;
||$wgGroupPermissions['sysop']['ns100_read'] = true;
||$wgGroupPermissions['sysop']['ns100_edit'] = true;
||$wgGroupPermissions['sysop']['ns100_create'] = true;
||$wgGroupPermissions['sysop']['ns100_move'] = true;
||
||In your case, I guess you just have to set up true instead of false
||for read and edit to "*" ... :D
||
||Note that, after this you can use Special:Userrights page to set the
||rights to a particular user ...
||
||Hope this can help you ...
||
||Just for information, I'm using MediaWiki 1.7.1 ... Which runs
||perfectly in my case ... No need to upgrade right now ... :D
||
||Le 23 oct. 06 à 01:12, Mauro do Carmo a écrit :
||
||> Hi Klint,
||>
||> I have a wiki where just logged people can edit.
||>
||> And I would like to allow anonymous people to edit everything
under
||> a certain nemaspace named 'logos:'.
||>
||> How should I do?
||>
||> Thanks a lot, mauro.
||>
||>
||> |-----Original Message-----
||> |From: mediawiki-l-bounces(a)Wikimedia.org [mailto:mediawiki-l-
||> bounces(a)Wikimedia.org] On Behalf Of KlinT
||> |Sent: Sunday, October 22, 2006 2:54 PM
||> |To: MediaWiki announcements and site admin list
||> |Subject: Re: [Mediawiki-l] Twiki or Wiki???
||> |
||> |
||> |Another solution is to play with NameSpaces ... So you can manage
||> |user/group access to these namespace ...
||> |
||> |Best Regards
||> |
||> |Le 22 oct. 06 à 23:38, Nicholas Buttle a écrit :
||> |
||> |> Hi,
||> |>
||> |> Overall I'm happier with the mediawiki system than the
||> |> Twiki. But I'm being asked to investigate the Twiki
||> |> system as the powers that be think it will be better
||> |> as a corporate knowledgebase (more control over user
||> |> access and better suited to a categorised information
||> |> resource). What I would like to know is...
||> |>
||> |> How much control can the admin exert over user access
||> |> to pages? ie can certain pages be locked down once
||> |> they have been created?
||> |>
||> |> And, can I create something with mediawiki that has
||> |> the categorisation of the Twiki system? I thought
||> |> about modifying the navigate menu to correspond to the
||> |> 'webs' menu on twiki...
||> |>
||> |> Any suggestions welcome.
||> |>
||> |> TIA
||> |>
||> |> Nicholas
||> |>
||> |> __________________________________________________
||> |> Do You Yahoo!?
||> |> Tired of spam? Yahoo! Mail has the best spam protection around
||> |>
http://mail.yahoo.com
||> |> _______________________________________________
||> |> MediaWiki-l mailing list
||> |> MediaWiki-l(a)Wikimedia.org
||> |>
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
||> |>
||> |
||> |_______________________________________________
||> |MediaWiki-l mailing list
||> |MediaWiki-l(a)Wikimedia.org
||> |http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
||> |
||> |--
||> |No virus found in this incoming message.
||> |Checked by AVG Free Edition.
||> |Version: 7.1.408 / Virus Database: 268.13.9/490 - Release Date:
||> 10/20/2006
||> |
||>
||> --
||> No virus found in this outgoing message.
||> Checked by AVG Free Edition.
||> Version: 7.1.408 / Virus Database: 268.13.9/490 - Release Date:
||> 10/20/2006
||>
||> _______________________________________________
||> MediaWiki-l mailing list
||> MediaWiki-l(a)Wikimedia.org
||>
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
||>
||
||_______________________________________________
||MediaWiki-l mailing list
||MediaWiki-l(a)Wikimedia.org
||http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
||
||--
||No virus found in this incoming message.
||Checked by AVG Free Edition.
||Version: 7.1.408 / Virus Database: 268.13.9/490 - Release Date:
10/20/2006
||
|
|--
|No virus found in this outgoing message.
|Checked by AVG Free Edition.
|Version: 7.1.408 / Virus Database: 268.13.9/490 - Release Date:
10/20/2006
|
|_______________________________________________
|MediaWiki-l mailing list
|MediaWiki-l(a)Wikimedia.org
|http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
|
|--
|No virus found in this incoming message.
|Checked by AVG Free Edition.
|Version: 7.1.408 / Virus Database: 268.13.9/490 - Release Date:
10/20/2006
|
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.9/490 - Release Date:
10/20/2006
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)Wikimedia.org
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l