On Aug 4, 2004, at 2:37 PM, Brion Vibber wrote:
Tor Bjornrud wrote:
> Are there ways to do one of the following?
>
> * Namespace the default set of documents and whitelist them,
> while creating a different namespace for the private pages?
> * Manage a blacklist of pages? Or blacklist a namespace?
There is not currently a blacklist feature, but it should be easy to
hack in. In Title.php there is this function:
function userCanRead() {
global $wgUser;
global $wgWhitelistRead;
if( 0 != $wgUser->getID() ) return true;
if( !is_array( $wgWhitelistRead ) ) return true;
$name = $this->getPrefixedText();
if( in_array( $name, $wgWhitelistRead ) ) return true;
# Compatibility with old settings
if( $this->getNamespace() == NS_MAIN ) {
if( in_array( ":" . $name, $wgWhitelistRead ) )
return true;
}
return false;
}
A blacklist will be the opposite of the whitelist:
if( in_array( $name, $wgBlacklistRead ) ) return false;
Or a namespace blacklist might look like:
if( in_array( $this->getNamespace(), $wgBlacklistNs ) ) {
return false;
}
However be careful; MediaWiki is designed for open access, and there
may be numerous ways around the poorly tested, little-used access
control features. I would not recommend relying on them for any
purpose; if you have information you wish to keep private, the best
way is to keep it completely separate from a public wiki database and
use HTTP authentication to control access at the highest level.
-- brion vibber (brion @
pobox.com)
Thanks a ton, Brion. This is pretty much what I was looking for, and
I'll hack something together... maybe even get it merged into future
versions.
Thankfully, what I need to keep separate is not top-secret stuff, and
it wouldn't be all that terrible if people stumbled upon it.
Best,
~Tor