Try this:<br><p><span style="font-size: x-small;"><span style="font-family: courier new,courier;">sub post_chain_root : Chained(&#39;/&#39;) CaptureArgs(0) {</span></span></p>
<p><span style="font-size: x-small;"><span style="font-family: courier new,courier;">    my ($self, $c) = @_;<br></span></span></p>
<p><span style="font-size: x-small;"><span style="font-family: courier new,courier;">    foreach my $action (@{$c-&gt;action-&gt;chain}) { <br>        my $role = $action-&gt;attributes-&gt;{RequiresRole}[0]; <br>        next unless $role; <br>


        ## test role here...<br>    }<br></span></span></p>
<p><span style="font-family: courier new,courier; font-size: x-small;"><span style="font-size: small; font-family: arial,helvetica,sans-serif;"><span style="font-size: x-small;"><span style="font-family: courier new,courier;">}</span></span></span></span></p>


<p><br><span style="font-family: courier new,courier; font-size: x-small;"><span style="font-size: small; font-family: arial,helvetica,sans-serif;"><span style="font-size: x-small;"><span style="font-family: courier new,courier;"></span></span></span></span></p>


That&#39;s a bit of code that you can put in the root of a Chained chain and do something like <br><p><span style="font-family: courier new,courier; font-size: x-small;">sub create_new_post : RequiresRole(&#39;can_post&#39;) {</span></p>



<p><span style="font-family: courier new,courier; font-size: x-small;"># ...</span></p>
<p><span style="font-family: courier new,courier; font-size: x-small;">}</span></p>HTH.<br><br><br><div class="gmail_quote">On Mon, Jul 13, 2009 at 12:50 AM, Toby Corkindale <span dir="ltr">&lt;<a href="mailto:toby.corkindale@strategicdata.com.au" target="_blank">toby.corkindale@strategicdata.com.au</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Devin Austin wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Check this out: <a href="http://search.cpan.org/%7Ehkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual/ExtendingCatalyst.pod#Attributes" target="_blank">http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual/ExtendingCatalyst.pod#Attributes</a> and <a href="http://search.cpan.org/%7Ehkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual/ExtendingCatalyst.pod#Action_classes" target="_blank">http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual/ExtendingCatalyst.pod#Action_classes</a><br>



</blockquote>
<br></div>
Thanks, although I had already read that before posting.<br>
<br>
As far as I can see, there is no way to pass parameters to the ActionClass. Have I missed something?<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>
On Mon, Jul 13, 2009 at 12:27 AM, Toby Corkindale &lt;<a href="mailto:toby.corkindale@strategicdata.com.au" target="_blank">toby.corkindale@strategicdata.com.au</a> &lt;mailto:<a href="mailto:toby.corkindale@strategicdata.com.au" target="_blank">toby.corkindale@strategicdata.com.au</a>&gt;&gt; wrote:<br>



<br>
    Toby Corkindale wrote:<br>
<br>
        Hi,<br>
        I wondered if anyone could point me towards a working example of<br>
        creating custom action attribute handlers for Catalyst?<br>
<br>
        eg. The contents of Catalyst::Controller::SecretAgent in the<br>
        example below:<br>
<br>
<br>
        package MyApp::Controller::M;<br>
        use parent &#39;Catalyst::Controller::SecretAgent&#39;;<br>
        # Provides Vehicle() and Gimmick() actions.<br>
<br>
        sub bond : Vehicle(&#39;Aston Martin&#39;) {<br>
         my ($self, $c) = @_;<br>
         # ...<br>
        }<br>
<br>
        sub maxwell_smart : Gimmick(&#39;Shoe-phone&#39;) {<br>
         My ($self, $c) = @_;<br>
         #...<br>
        }<br>
<br>
        1;<br>
<br>
<br>
<br>
    I should clarify what I&#39;m after..<br>
    I&#39;d still like to be able to specify regular DispatchType attributes<br>
    against the routines (eg. Local, Chained, etc), but I&#39;d also like to<br>
    have my own methods called against the other attributes I&#39;ve specified.<br>
<br>
    The first method I tried was:<br>
     package Catalyst::Controller::SecretAgent;<br>
     use strict / use warnings<br>
     use parent &#39;Catalyst::Controller&#39;;<br>
     use attributes __PACKAGE__ =&gt; \&amp;set_vehicle, &quot;Vehicle&quot;;<br>
     sub set_vehicle { # do something }<br>
     ...<br>
<br>
    but I think that messes up catalyst&#39;s own handling of attributes.<br>
<br>
<br>
    _______________________________________________<br></div></div>
    List: <a href="mailto:Catalyst@lists.scsys.co.uk" target="_blank">Catalyst@lists.scsys.co.uk</a> &lt;mailto:<a href="mailto:Catalyst@lists.scsys.co.uk" target="_blank">Catalyst@lists.scsys.co.uk</a>&gt;<div>
<br>
    Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
    Searchable archive:<br>
    <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
    Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
<br>
<br>
<br>
<br>
-- <br>
Devin Austin<br>
<a href="http://www.codedright.net" target="_blank">http://www.codedright.net</a><br>
<a href="http://www.dreamhost.com/r.cgi?326568/hosting.html" target="_blank">http://www.dreamhost.com/r.cgi?326568/hosting.html</a> - Host with DreamHost!<br>
<br>
<br></div>
------------------------------------------------------------------------<div><br>
<br>
_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk" target="_blank">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
</div></blockquote><font color="#888888">
<br>
<br>
-- <br>
Strategic Data Pty Ltd<br>
Ph: 03 9340 9000</font><div><div></div><div><br>
<br>
_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk" target="_blank">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Devin Austin<br><a href="http://www.codedright.net" target="_blank">http://www.codedright.net</a><br><a href="http://www.dreamhost.com/r.cgi?326568/hosting.html" target="_blank">http://www.dreamhost.com/r.cgi?326568/hosting.html</a> - Host with DreamHost!<br>