Mailing List Archive

In ActionRole is NotDoes Available?
Hi All,

I have applied some Action Roles to all the controllers to work without
specifying Does keyword in every action function. Now I have a situation
where I want "NotDoes" function so that I don't use one of the default
Roles.

For Eg:

package MyApp::Controller::Bar<https://metacpan.org/module/MyApp::Controller::Bar>

use Moose <https://metacpan.org/module/Moose>;
use namespace::autoclean <https://metacpan.org/module/namespace::autoclean>;

BEGIN { extends 'Catalyst::Controller::ActionRole' }

__PACKAGE__->config(
action_roles => ['Foo', 'Bar'],
);

sub moo : Local { ... }

*sub go : Path NotDoes('Foo') { ... }*

Please let me know how can I do this?


Best Regards,
Alex
Re: In ActionRole is NotDoes Available? [ In reply to ]
No this functionality not does exist.  

The best approach I think is to have more than one base controller or roles if you need that.

good luck, jnap



On Wednesday, December 4, 2013 11:36 PM, Sheeju Alex <sheejuec7@gmail.com> wrote:

Hi All,
  
    I have applied some Action Roles to all the controllers to work without specifying Does keyword in every action function. Now I have a situation where I want "NotDoes" function so that I don't use one of the default Roles.

For Eg:



package MyApp::Controller::Bar
 
use Moose;
use namespace::autoclean;
 
BEGIN { extends 'Catalyst::Controller::ActionRole' }
 
__PACKAGE__->config(
    action_roles => ['Foo', 'Bar'],
);
sub moo : Local { ... }


sub go : Path NotDoes('Foo') { ... }


Please let me know how can I do this?



Best Regards,    
Alex

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
Re: In ActionRole is NotDoes Available? [ In reply to ]
Thanks John, I have found a work around to use $c->stash to return before
the default ActionRole is executed.


Best Regards,
Sheeju Alex


On Fri, Dec 6, 2013 at 3:27 AM, John Napiorkowski <jjn1056@yahoo.com> wrote:

> No this functionality not does exist.
>
> The best approach I think is to have more than one base controller or
> roles if you need that.
>
> good luck, jnap
>
>
> On Wednesday, December 4, 2013 11:36 PM, Sheeju Alex <
> sheejuec7@gmail.com> wrote:
> Hi All,
>
> I have applied some Action Roles to all the controllers to work
> without specifying Does keyword in every action function. Now I have a
> situation where I want "NotDoes" function so that I don't use one of the
> default Roles.
>
> For Eg:
>
> package MyApp::Controller::Bar<https://metacpan.org/module/MyApp::Controller::Bar>
>
> use Moose <https://metacpan.org/module/Moose>;
> use namespace::autoclean<https://metacpan.org/module/namespace::autoclean>
> ;
>
> BEGIN { extends 'Catalyst::Controller::ActionRole' }
>
> __PACKAGE__->config(
> action_roles => ['Foo', 'Bar'],
> );
>
> sub moo : Local { ... }
>
> *sub go : Path NotDoes('Foo') { ... }*
>
> Please let me know how can I do this?
>
>
> Best Regards,
> Alex
>
> _______________________________________________
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
>
> _______________________________________________
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>