]>
iEval git - apache2-authzcaps.git/blob - lib/Apache2_4/AuthzCaps.pm
1 package Apache2_4
::AuthzCaps
;
7 our $VERSION = '0.002';
9 use Apache2
::AuthzCaps
'hascaps';
10 use Apache2
::Const qw
/AUTHZ_GRANTED AUTHZ_DENIED AUTHZ_DENIED_NO_USER/;
11 use Apache2
::RequestRec
;
12 use Apache2
::RequestUtil
;
14 ##################################################
16 # General handler template stolen from Apache2_4::AuthCookie
20 local $Apache2::AuthzCaps
::rootdir
= $r->dir_config('AuthzCapsRootdir');
21 return AUTHZ_DENIED_NO_USER
unless $user;
22 my @caps = split ' ', $caps;
23 hascaps
($user, @caps) ? AUTHZ_GRANTED
: AUTHZ_DENIED
33 Apache2_4::AuthzCaps - mod_perl2 capability authorization for Apache 2.4
38 PerlAddAuthzProvider cap Apache2_4::AuthzCaps
40 # Insert authentication here
41 PerlSetVar AuthzCapsRootdir /path/to/user/directory
42 Require cap staff important
46 # 1) Let important staff members access /protected
47 # 2) Let admins access /protected
48 # 3) Not let anyone else (such as an important non-staff member or an non-important staff member) access /protected
52 Apache2_4::AuthzCaps is a modification of L<Apache2::AuthzCaps> for
53 Apache 2.4. See that module's documentation for helper functions and
58 Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
60 =head1 COPYRIGHT AND LICENSE
62 Copyright (C) 2013-2015 by Marius Gavrilescu
64 This library is free software; you can redistribute it and/or modify
65 it under the same terms as Perl itself, either Perl version 5.14.2 or,
66 at your option, any later version of Perl 5 you may have available.
This page took 0.042709 seconds and 4 git commands to generate.