
Byron.Young at riverbed
Jun 30, 2008, 12:43 PM
Post #2 of 3
(385 views)
Permalink
|
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 _______________________________________________ List: Catalyst [at] lists Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst [at] lists/ Dev site: http://dev.catalyst.perl.org/
|