[Catalyst] Re: ACL confusion
    Chisel Wright 
    chisel at herlpacker.co.uk
       
    Thu Mar 20 19:57:14 GMT 2008
    
    
  
On Thu, Mar 20, 2008 at 01:39:58PM +0100, Aristotle Pagaltzis wrote:
> (You mean the advent entry.)
I mean the cookbook. I copied the example below straight out of "Access
Control Lists" in Catalyst::Manual::Cookbook
> >    Zoo->deny_access_unless( "/moose_cage", sub {
> >        my $c = shift;
> >           $c->check_roles( "moose_trainer" )
> >        || $c->check_roles( "moose_feeder" );
> >    });
> But you can write multiple rules for the same action; why not do
> it that way?
> 
>     __PACKAGE__->deny_access_unless( '/books/delete', [ $_ ] )
>         for qw/user admin/;
Because it still behaves in an AND-like manner.
>     Zoo->deny_access_unless( '/moose_cage', sub {
>         shift->check_any_user_role( qw( moose_trainer moose_feeder ) );
>     });
Yes, this is the route I ended up taking, and as far as I can tell, it
does what I'm looking for.
Cheers,
Chisel
-- 
Chisel Wright
e: chisel at herlpacker.co.uk
w: http://www.herlpacker.co.uk/
  There is no theory of evolution. Just a list of
  creatures Chuck Norris has allowed to live.
    
    
More information about the Catalyst
mailing list