Peter Velan | 1 Mar 14:30 2009
Picon

Re: Limiting use/visibility of special-pages

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;
}
#~~~~~~~~~~~~~~~~~~

(Continue reading)

Platonides | 1 Mar 19:15 2009
Picon

Re: Limiting use/visibility of special-pages

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.

(Continue reading)

Peter Velan | 1 Mar 23:08 2009
Picon

Re: Limiting use/visibility of special-pages

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).
>> 
(Continue reading)

Platonides | 1 Mar 23:36 2009
Picon

Re: Limiting use/visibility of special-pages

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
Peter Velan | 3 Mar 21:12 2009
Picon

Re: Limiting use/visibility of 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

Gmane