Apache-SiteControl
view release on metacpan or search on metacpan
lib/Apache/SiteControl.pm view on Meta::CPAN
Whenever a login attempt succeeds, the factory returns an object that
represents a valid, logged-in user. See Apache::SiteControl::UserFactory for
more information.
=head2 PERMISSION MANAGER
Each site will have a permission manager. There is usually no need for you
to subclass Apache::SiteControl::PermissionManager, but you do need to create one
and populate it with your access rules. You do this by creating a
factory class, which looks something like this:
package samples::site::MyPermissionFactory;
use Apache::SiteControl::PermissionManager;
use Apache::SiteControl::GrantAllRule;
use samples::site::EditControlRule;
use base qw(Apache::SiteControl::ManagerFactory);
our $manager;
lib/Apache/SiteControl.pm view on Meta::CPAN
deal with both possibilities. In this example we are assuming that the user is
implemented as an object that has attributes which can be retrieved with a
getAttribute method (of course, you would have to have implemented that as
well). The basic action that this rule handles is called "beat up", so the site
makes calls like:
if($referee->can($userA, "beat up", $userB)) { ... }
In terms of English, we would describe the rule "If A is taller than B, then
we say that A can beat up B. If A is less skilled than B, then we say that
A cannot beat up B". The rule looks like this:
package samples::FightRules;
use strict;
use warnings;
use Carp;
use Apache::SiteControl::Rule;
use base qw(Apache::SiteControl::Rule);
( run in 0.525 second using v1.01-cache-2.11-cpan-64827b87656 )