Catalyst-Plugin-Authorization-ACL

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/Authorization/ACL.pm  view on Meta::CPAN

=item forcibly_allow_access

Within an C<access_denied> action this will immediately cause the blocked
action to be executed anyway.

=back

This means that you have several alternatives:

=head2 Provide an C<access_denied> action

    package MyApp::Controller::Foo;

    sub access_denied : Private {
        my ( $self, $c, $action ) = @_;

        ...
        $c->forcibly_allow_access
            if $you->mean_it eq "really";
    }

If you call C<forcibly_allow_access> then the blocked action will be
immediately unblocked. Otherwise the execution of the action will cease, and
return to it's caller or end.

=head2 Cleanup in C<end>

    sub end : Private {
        my ( $self, $c ) = @_;

        if ( $c->error and $c->error->[-1] eq "access denied" ) {
            $c->error(0); # clear the error

            # access denied
        } else {
            # normal end
        }
    }

=head2 Override the plugin event handler methods

    package MyApp;

    sub acl_access_allowed {
        my ( $c, $class, $action ) = @_;
        ...
    }

    sub acl_access_denied {
        my ( $c, $class, $action, $err ) = @_;
        ...
    }

C<$class> is the controller class the C<$action> object was going to be
executed in, and C<$err> is the exception cought during rule evaluation, if
any (access is denied if a rule raises an exception).

=head1 SEE ALSO

L<Catalyst::Plugin::Authentication>, L<Catalyst::Plugin::Authorization::Roles>,
L<http://catalyst.perl.org/calendar/2005/24>

=head1 AUTHOR

Yuval Kogman E<lt>nothingmuch@woobling.orgE<gt>

=head1 CONTRIBUTORS

castaway: Jess Robinson

caelum: Rafael Kitover E<lt>rkitover@cpan.orgE<gt>

=head1 COPYRIGHT & LICENSE

Copyright (c) 2005 - 2009
the Catalyst::Plugin::Authorization::ACL L</AUTHOR> and L</CONTRIBUTORS>
as listed above.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself. 

=cut



( run in 4.906 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )