[Catalyst] Why no extra attributes on Private actions?

Matt S Trout dbix-class at trout.me.uk
Wed Jan 23 05:57:32 GMT 2008


On Tue, Jan 22, 2008 at 12:53:49PM -0500, Christopher H. Laco wrote:
> Bill Moseley wrote:
> >In Catalyst::Controller register_actions() there's this code:
> >
> >    my $attrs = $self->_parse_attrs( $c, $method, @{ $cache->[1] } );
> >    if ( $attrs->{Private} && ( keys %$attrs > 1 ) ) {
> >        $c->log->debug( 'Bad action definition "'
> >              . join( ' ', @{ $cache->[1] } )
> >              . qq/" for "$class->$method"/ )
> >          if $c->debug;
> >        next;
> >    }
> >
> >Why are no other attributes allowed if the action include the
> >"Private" attribute?
> >
> >
> >This came up because I'm using "SSL" to indicate actions that require
> >SSL:
> >
> >    sub secret : Local SSL {}
> >
> >
> >But, it would also be handy to be able to protect all actions below 
> >a give controller via:
> >
> >    sub auto : Private SSL { 1 }
> >
> >
> 
> Why not just leave off Private altogether?
> 
> I did that with index/default all the time until I weend myself off of 
> them for Chained for just that reason.
> 
> Now, about the sub named 'index' being a special name that does evil 
> when you do sub index : Chained because  is the most appropriate 
> name...... that's another story...

I foresee index and default going the fuck away for 5.80 unless you're in
compat mode.

Hate hate hate hate hate hate HATE.

(and :Private can fucking die while we're there too, probably we'll move to
recommending :Action which is what I tend to use to get around Private's
odd behaviour)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst mailing list