[Catalyst] Controller::ActionRole and Controller::FormFu

Tobias Klug tklug at hartle-klug.de
Tue May 24 11:07:10 GMT 2011


Hi,

I just started using Catalyst::Controller::ActionRole to make
authorization within my application more consistent. However, in
controllers that use FormFu for form handling, it does not work as
expected. As I am no expert in Moose-stuff, I wanted to ask if I am
doing the right thing.

As the controller needs to inherit from ActionRole and FormFu, I wrote
the following, which is possible according to the Moose manual:

use Moose;
BEGIN { extends 'Catalyst::Controller::ActionRole',
'Catalyst::Controller::HTML::FormFu' };

The form action is declared like this:

sub settings :
        Chained('base')
        Args(0)

        Does(ACL)
        RequiresRole('some-role')
        ACLDetachTo('/permission_denied')

        FormConfig
{
    my ($self, $c) = @_;
   ...
}

However, depending on the order of the arguments of 'extends' either the
forms are working or authorization, but never both.

Is there a way to get both modules work together in the same
controller/action?

Best regards,

Tobias



More information about the Catalyst mailing list