[Catalyst] configuring plugin's

Byron Young Byron.Young at riverbed.com
Mon Jun 30 20:43:06 BST 2008


Dermot wrote on 2008-06-30:
> Hi,
>
> I seem to be struggling with the configuring of plugins, in this case
> Authorization::Roles.
>
> I have the following in lib/MyApp.pm
>
> __PACKAGE__->setup(qw/-Debug
>                         ConfigLoader
>                         Static::Simple
>                         StackTrace
>                         Authentication
>                         Authorization::Roles
>                         Session::State
>                         Session::Store
>                         Session::Store::FastMmap
>                         Session
>                         /);
>
> and MyApp.yml has
>
> name: MyApp
> Model::MyAppDB:
>   connect_info:
>     - DBI:SQLite:__HOME__/MyApp.db
> Authentication:
>  default_realm: user
>  realms:
>   user:
>    credential:
>     class: Password password_field: password password_type: clear store:
>     class: DBIx::Class user_class: UsersRoles role_relation: role_id
>     role_field: role
>  I think that all the above is correctly configured. The grapping void
> in my understanding is making the schema available in my methods. So
>
> sub list : Local {
>   my ($self, $c) = @_;
>   print STDERR "login=",$c->check_roles('admin'),"\n";
>   $c->detach('denied') unless $c->check_roles('admin');
>   $c->stash->{stuff} = [$c->model('MyAppDB::Stuff')->all];
>   $c->stash->{template} = 'submissions/list.tt2
> }
>
> Give me the error:
>
> Can't locate object method "asser_user_roles" via package "MyApp
>

Looks like you have a typo somewhere.  Should be 'assert_user_roles', maybe?

byron




More information about the Catalyst mailing list