NAME

PurpleWiki::ACL - Access control list.

SYNOPSIS

use PurpleWiki::ACL;

my $acl = PurpleWiki::ACL->new;

if ($acl->canEdit($user, $pageId)) {
    # let the user edit the page
}
else {
    # return error message
}

DESCRIPTION

Access control list for PurpleWiki. Currently, always returns true for canRead and false for canAdmin. If LoginToEdit is true in the config file, then will require the user to be logged in for canEdit to return true.

This can easily be subclassed for more sophisticated ACL schemes.

METHODS

new()

Constructor.

canRead($user, $pageId)

Always returns true.

canEdit($user, $pageId)

If LoginToEdit is set, only returns true if user object is defined (i.e. user is logged in).

Also checks to see if IP address/hostname is on the banlist.

canAdmin($user, $pageId)

Always returns false.

AUTHOR

Eugene Eric Kim, <eekim@blueoxen.org>