Apache...::Rule(3pm)
π NAME π
okay so bestie, welcome to Apache2::SiteControl::Rule β the permission manager access rule. that's the whole name. she's a rule, she manages access. slay. π
β¨ DESCRIPTION β¨
so like. every single rule is a custom-written class of your own making that handles one lil' slice of your site's access logic. rules get to choose whether they grant a request or deny it. that's it, that's the job. π«Ά
here's what a rule looks like in the wild, and yes you're gonna want to read the whole thing:
package sample::Test;
use strict;
use warnings;
use Carp;
use Apache2::SiteControl::Rule;
use base qw(Apache2::SiteControl::Rule);
sub grants($$$$)
{
my $this = shift;
my $user = shift;
my $action = shift;
my $resource = shift;
if($action eq "edit" && $resource->isa("sample::Record")) {
return 1 if($user{name} eq "root");
}
return 0;
}
sub denies($$$$)
{
return 0;
}
1;
k so the way the PermissionManager works β and this is the important bit, no cap β it will only give permission if at least one rule grants permission, and no rule denies it. both conditions. periodt. β¨
π¨ okay real talk bestie, listen up: it is super important that your rules never grant or deny a request they do not understand. like, if you don't get the vibe, don't make a call on it, okay?? so it's a really good idea to use type checking to prevent strangeness. π
π and like, assertions should not be used if you expect different rules to accept different resource types or user types β because each rule is used on every access request. every. single. one. so a rule that freaks out on stuff it wasn't built for? it's giving disaster. don't do that. π
π¦ EXPORT π¦
None by default. that's it, that's the whole section, she's low maintenance, we love that for her. π¦
π SEE ALSO π
go read these next, they're all icons:
Apache2::SiteControl::UserFactoryApache::SiteControl::ManagerFactoryApache2::SiteControl::PermissionManagerApache2::SiteControl
π AUTHOR π
this module was written by Tony Kay, <tkay@uoregon.edu>. we stan. π
π COPYRIGHT AND LICENSE π
that's the heading. the section is... empty. nothing under it. it's giving mysterious main character energy and honestly? we respect it. π§
and that's the whole page bestie!! this was perl v5.26.2, dated 2018-08-31, from the User Contributed Perl Documentation collection. mwah, go write some rules πβ¨πΈ
π¦ where this page comes from
- debian trixie: libapache2-sitecontrol-perl 1.05-2 Β· GPL-1.0-or-later
- ubuntu jammy: libapache2-sitecontrol-perl 1.05-2 Β· GPL-1.0-or-later
- ubuntu noble: libapache2-sitecontrol-perl 1.05-2 Β· GPL-1.0-or-later
- ubuntu resolute: libapache2-sitecontrol-perl 1.05-2 Β· GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms