Hello,
I installed the extension http://www.mediawiki.org/wiki/Extension:NamespacePermissions.
After defining new groups and granting rights to some users, these rights are shown in detail on Special:ListUsers. How could I remove this information from page Special:ListUsers?
Could I declare every Special:<page> to be a "Restricted special page" (a page beeing shown in bold on "Special:SpecialPages" )?
TIA Peter
Peter Velan wrote:
Hello,
I installed the extension http://www.mediawiki.org/wiki/Extension:NamespacePermissions.
After defining new groups and granting rights to some users, these rights are shown in detail on Special:ListUsers. How could I remove this information from page Special:ListUsers?
Could I declare every Special:<page> to be a "Restricted special page" (a page beeing shown in bold on "Special:SpecialPages" )?
TIA Peter
Add a check on namespacePermissionsCheckNamespace() for namespace -1 (special).
You may also be able to achieve the same using the Lockdown extension http://www.mediawiki.org/wiki/Extension:Lockdown It allows both namespace restriction ($wgNamespacePermissionLockdown) and special page restriction ($wgSpecialPageLockdown).
am 17.02.2009 14:21 schrieb Platonides:
Peter Velan wrote:
I installed the extension http://www.mediawiki.org/wiki/Extension:NamespacePermissions.
After defining new groups and granting rights to some users, these rights are shown in detail on Special:ListUsers. How could I remove this information from page Special:ListUsers?
Could I declare every Special:<page> to be a "Restricted special page" (a page beeing shown in bold on "Special:SpecialPages" )?
Add a check on namespacePermissionsCheckNamespace() for namespace -1 (special).
Ah ok, you mean, that I should modify this routine ...
#~~~~~~~~~~~~~~~~~~ function namespacePermissionsCheckNamespace( $title, $user, $action, $result ) { if ( ( $ns = $title->getNamespace() ) >= 100 ) { if ( ! $user->isAllowed("ns{$ns}_{$action}") ) { $result = false; return false; } } return true; } #~~~~~~~~~~~~~~~~~~
... to return a FALSE if called with which arguments? Could you please declare it with more detail?
You may also be able to achieve the same using the Lockdown extension http://www.mediawiki.org/wiki/Extension:Lockdown It allows both namespace restriction ($wgNamespacePermissionLockdown) and special page restriction ($wgSpecialPageLockdown).
Yep, this one works, but the first method would not require an additional extension to be installed.
Greetings, Peter
Peter Velan schrieb:
Ah ok, you mean, that I should modify this routine ...
#~~~~~~~~~~~~~~~~~~ function namespacePermissionsCheckNamespace( $title, $user, $action, $result ) { if ( ( $ns = $title->getNamespace() ) >= 100 ) { if ( ! $user->isAllowed("ns{$ns}_{$action}") ) { $result = false; return false; } }
return true; } #~~~~~~~~~~~~~~~~~~
... to return a FALSE if called with which arguments? Could you please declare it with more detail?
Yes. Add if ($ns == -1) return false; before the return true.
You may also be able to achieve the same using the Lockdown extension http://www.mediawiki.org/wiki/Extension:Lockdown It allows both namespace restriction ($wgNamespacePermissionLockdown) and special page restriction ($wgSpecialPageLockdown).
Yep, this one works, but the first method would not require an additional extension to be installed.
You can completely replace NamespacePermissions with Lockdown.
am 01.03.2009 19:16 schrieb Platonides:
Peter Velan schrieb:
Ah ok, you mean, that I should modify this routine ...
#~~~~~~~~~~~~~~~~~~ function namespacePermissionsCheckNamespace( $title, $user, $action, $result ) { if ( ( $ns = $title->getNamespace() ) >= 100 ) { if ( ! $user->isAllowed("ns{$ns}_{$action}") ) { $result = false; return false; } }
return true; } #~~~~~~~~~~~~~~~~~~
... to return a FALSE if called with which arguments? Could you please declare it with more detail?
Yes. Add if ($ns == -1) return false; before the return true.
Hmm now even the sysop has no chance to open a special page :-(
You may also be able to achieve the same using the Lockdown extension http://www.mediawiki.org/wiki/Extension:Lockdown It allows both namespace restriction ($wgNamespacePermissionLockdown) and special page restriction ($wgSpecialPageLockdown).
Yep, this one works, but the first method would not require an additional extension to be installed.
You can completely replace NamespacePermissions with Lockdown.
Ah, ok will take a closer look to Lockdown and select the extension best suited to our needs!
Thanks for the quick response! Peter
Peter Velan wrote:
... to return a FALSE if called with which arguments? Could you please declare it with more detail?
Yes. Add if ($ns == -1) return false; before the return true.
Hmm now even the sysop has no chance to open a special page :-(
Whoops. Use instead. if ($ns == -1) return $user->isAllowed("specialpages");
And grant the specialpages rights to the groups which should be able to use the Special: pages
am 01.03.2009 23:36 schrieb Platonides:
Peter Velan wrote:
... to return a FALSE if called with which arguments? Could you please declare it with more detail?
Yes. Add if ($ns == -1) return false; before the return true.
Hmm now even the sysop has no chance to open a special page :-(
Whoops. Use instead. if ($ns == -1) return $user->isAllowed("specialpages");
And grant the specialpages rights to the groups which should be able to use the Special: pages
I tried it and everything looked fine, until ... one of my "normal" users reported, that he can't upload pdf files anymore. <sigh>
Now I'm using both extensions (NamespacePermissions and LockDown) and this setup seems to fulfill our requirements.
Platonides, thanks a lot for your patience! Peter
Peter Velan wrote:
I tried it and everything looked fine, until ... one of my "normal" users reported, that he can't upload pdf files anymore. <sigh>
xD They would also have problems changing their preferences. Your approach of "blocking all special pages" was too strict.
Platonides, thanks a lot for your patience! Peter
You're welcome :)
2009/2/14 Peter Velan pv0001@dynapic.net:
Hello,
I installed the extension http://www.mediawiki.org/wiki/Extension:NamespacePermissions.
After defining new groups and granting rights to some users, these rights are shown in detail on Special:ListUsers. How could I remove this information from page Special:ListUsers?
Could I declare every Special:<page> to be a "Restricted special page" (a page beeing shown in bold on "Special:SpecialPages" )?
If you're happy altering the PHP just change this line in SpecialListUser.php
$item = wfSpecialList( $name, $groups );
to
$item = wfSpecialList( $name );
(I haven't tested that, but it ought to work.)
Of course, that stops even admins seeing the list of user groups. If you want admins to still be able to see it, try something like
if ($wgUser->isAllowed('viewusergroups') then $item = wfSpecialList( $name, $groups ); else $item = wfSpecialList( $name );
(Don't forget to add 'global $wgUser' to the top of the function.)
And then give admins, any whoever else, the viewusergoups permission.
Remember, such changes to the PHP will be undone should you upgrade to a new version of MediaWiki.
am 04.03.2009 00:44 schrieb Thomas Dalton:
2009/2/14 Peter Velan pv0001@dynapic.net:
Hello,
I installed the extension http://www.mediawiki.org/wiki/Extension:NamespacePermissions.
After defining new groups and granting rights to some users, these rights are shown in detail on Special:ListUsers. How could I remove this information from page Special:ListUsers?
Could I declare every Special:<page> to be a "Restricted special page" (a page beeing shown in bold on "Special:SpecialPages" )?
If you're happy altering the PHP just change this line in SpecialListUser.php
Well, there are circumstances where altering of the code is ok; thats what *open* source is all about ;-)
$item = wfSpecialList( $name, $groups );
to
$item = wfSpecialList( $name );
(I haven't tested that, but it ought to work.)
Of course, that stops even admins seeing the list of user groups. If you want admins to still be able to see it, try something like
if ($wgUser->isAllowed('viewusergroups') then $item = wfSpecialList( $name, $groups ); else $item = wfSpecialList( $name );
(Don't forget to add 'global $wgUser' to the top of the function.)
And then give admins, any whoever else, the viewusergoups permission.
Thanks for the tip, but this ...
Remember, such changes to the PHP will be undone should you upgrade to a new version of MediaWiki.
... is the reason I don't like to fiddle inside of maintained code. I'm almost sure that I will forget to adapt the code after the next mediawiki upgrade.
Greetings, Peter
mediawiki-l@lists.wikimedia.org