1 package Catalyst
::Plugin
::Authorization
::ACL
::Paranoid
::Engine
;
7 my ( $class, $c ) = @_;
9 my $self = bless { rules
=> {} }, $class;
15 my ( $self, $rules ) = @_;
17 $self->{ rules
} = {};
19 while ( my ( $action, $check ) = each %$rules ) {
20 $action =~ s/^\///o unless $action eq '/';
22 $self->{ rules }->{ $action } =
23 ref $check eq 'CODE
' ? $check : sub { $check }
28 my ( $self, $c, $class, $action ) = @_;
33 && ( $action =~ m/\/?(?:_[A-Z]+|auto|begin|end)$/o
34 || $action =~ m/(?:->process$|^default$)/o )
40 if ( my $check = $self->{ rules }->{ $action } ) {
41 my $ret = $check->( $c );
46 if ( my $check = $self->{ rules }->{ '*' } ) {
47 return $check->( $c );
59 This program is free software, you can redistribute it and/or modify it under
60 the same terms as Perl itself.