X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FApache2%2FAuthzCaps.pm;fp=lib%2FApache2%2FAuthzCaps.pm;h=8ffaaac79cbc99f995be0d6e8ee596b9aa2877e7;hb=139b349117794fae33d5132b9dd97a0f9ab03ee6;hp=281d3d6f6e3b63eaa9874172ea00f5030901bbc5;hpb=59f2225d192cda0f843a9d5f99892e60b5a95341;p=apache2-authzcaps.git diff --git a/lib/Apache2/AuthzCaps.pm b/lib/Apache2/AuthzCaps.pm index 281d3d6..8ffaaac 100644 --- a/lib/Apache2/AuthzCaps.pm +++ b/lib/Apache2/AuthzCaps.pm @@ -4,7 +4,7 @@ use 5.014000; use strict; use warnings; use subs qw/OK DECLINED/; -no if $] >= 5.017011, warnings => 'experimental::smartmatch'; + our $VERSION = '0.001001'; use if $ENV{MOD_PERL}, 'Apache2::Access'; @@ -47,15 +47,10 @@ sub handler{ local $rootdir = $r->dir_config('AuthzCapsRootdir'); if ($user) { - LOOP: for my $requirement (map { $_->{requirement} } @{$r->requires}) { + for my $requirement (map { $_->{requirement} } @{$r->requires}) { my ($command, @args) = split ' ', $requirement; - given ($command){ - when('cap'){ - return OK if hascaps $user, @args - } - - } + return OK if $command eq 'cap' && hascaps $user, @args; } }