/usr/share/perl5/Apache2/SiteControl/GrantAllRule.pm is in libapache2-sitecontrol-perl 1.05-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | package Apache2::SiteControl::GrantAllRule;
use 5.008;
use strict;
use warnings;
use Carp;
use Carp::Assert;
use Apache2::SiteControl::Rule;
use base qw(Apache2::SiteControl::Rule);
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my $this = { };
bless ($this, $class);
return $this;
}
sub grants($$$$)
{
my $this = shift;
my $user = shift;
my $action = shift;
my $resource = shift;
return "Default is to allow";
}
sub denies($$$$)
{
my $this = shift;
my $user = shift;
my $action = shift;
my $resource = shift;
return 0;
}
1;
__END__
=head1 NAME
Apache2::SiteControl::GrantAllRule - A rule that grants permission to do everything.
=head1 SYNOPSIS
In your instance of a ManagerFactory:
=over 4
use Apache2::SiteControl::GrantAllRule;
...
sub getPermissionManager
{
...
$manager->addRule(new Apache2::SiteControl::GrantAllRule);
...
return $manager;
}
=back
=head1 DESCRIPTION
Apache2::SiteControl::GrantAllRule is a pre-built rule that grants access for
all permission requests. This rule can be used to help implement a system that
has a default policy of allowing access, and to which you add rules that deny
access for specific cases.
Note that the loose type checking of Perl makes this inherently dangerous,
since a typo is likely to fail to deny access. It is recommended that you
take the opposite approach with your rules, since a typo will err on the
side of denying access. The former is a security hole, the latter is a bug
that people will complain about (so you can fix it).
=head1 SEE ALSO
Apache2::SiteControl::ManagerFactory, Apache::SiteControl::PermissionManager,
Apache2::SiteControl::Rule
=head1 AUTHOR
This module was written by Tony Kay, E<lt>tkay@uoregon.eduE<gt>.
=head1 COPYRIGHT AND LICENSE
=cut
|