Thanks a lot for the explanation. I will try the approach you suggested.

Cheers,

Tobias

On 25.05.2011 11:17, Peter Shangov wrote:
> Hi Tobias,
>
> You cannot use Controller::FormFu together with Controller::ActionRole - both 
> inherit from Catalyst::Controller and attempting to inherit from both of them 
> creates a mess. 
>
> C::FF is just sugar over ordinary HTML::FormFu syntax. The C::FF docs explain 
> exactly what 'FormConfig' and the other attributes do, so you should use that 
> extended syntax instead, i.e.:
>
> sub settings :
>         Chained('base')
>         Args(0)
>         Does(ACL)
>         RequiresRole('some-role')       
>         ACLDetachTo('/permission_denied')
> {
>     my ($self, $c) = @_;
>     my $form = HTML::FormFu->new;
>     $form->load_config_filestem('root/forms/settings');
>     ...
> }
>  
> Ideally C::FF will be implemented as an action role in the future, but this 
> has not been done yet.
>
> Cheers,
>
> --
> Peter
>
> --- On Tue, 24/5/11, Tobias Klug <[email protected]> wrote:
>
>> From: Tobias Klug <[email protected]>
>> Subject: [Catalyst] Controller::ActionRole and Controller::FormFu
>> To: "The elegant MVC web framework" <[email protected]>
>> Date: Tuesday, 24 May, 2011, 14:07
>> 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
>>
>> _______________________________________________
>> List: [email protected]
>> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>> Searchable archive: http://www.mail-archive.com/[email protected]/
>> Dev site: http://dev.catalyst.perl.org/
>>
> _______________________________________________
> List: [email protected]
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/[email protected]/
> Dev site: http://dev.catalyst.perl.org/


_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to