[Catalyst] Perl code attributes in Moose roles

Bernhard Graf catalyst4 at augensalat.de
Mon Dec 21 23:25:43 GMT 2009


Eden Cardim schrieb:
>>>>>> "Bernhard" == Bernhard Graf <catalyst4 at augensalat.de> writes:
> 
>     Bernhard> Now this becomes:
> 
>     Bernhard>   package MyApp::Base::User; with
>     Bernhard> 'MyApp::Role::Controller::Create';
> 
>     Bernhard>   package MyApp::Base::Page; with
>     Bernhard> 'MyApp::Role::Controller::Create';
> 
>     Bernhard> Where can I add the ACL attributes for edit_new?
> 
> Try MooseX::Role::Parameterized

What would this help here?

Actually my last question was not Role specific - the problem is the
same with normal sub classing.
The question was about how to define Perl code attributes (not Moose
attributes) in a sub class for a method that is located in the base class:

Base class:

  package MyApp::Base::Class;
  sub edit : PathPart(edit) Chained(root) Args(0) { }

Sub class:

  package MyApp::Sub::Class;
  parent 'MyApp::Base::Class';


MyApp::Sub::Class inherits method edit() from MyApp::Base::Class.
I want the following authorization settings for the edit() method only
for the sub class:

  Does(ACL) AllowedRole(admin) ACLDetachTo(/forbidden)

Since there is no edit() method explicitly defined in the sub class, I
cannot add those attributes to it.


Bernhard Graf



More information about the Catalyst mailing list