On 24 Nov 2011, at 12:40, Johannes Kilian wrote:
Questions:
* Isn't $c->user a persistent value within $c? When I try to access
to c.user later (after "successfull" login) $c->user is undefined.
What is neccessary to make it persistent?
The Session plugin.
* When I try to check the user role for example via $c-
>assert_user_roles( qw/Wizard/ );
(c.user.fk_bdbrolle_pk.bdbrolle_name has been Wizard in my example)
this fails completely: Caught exception in
BDBInfo2::Controller::Root->login "Can't locate object method
"search" via package "BDBInfo2::Model::BDB::Bdbrolle" at .../
Catalyst/Authentication/Store/DBIx/Class/User.pm line 144." What's
wrong here?
Yeah, the user class expects you to have a many-to-many here.
The best solution is to subclass
Catalyst::Authentication::Store::DBIx::Class::User in your application
(as MyApp::User or whatever), then re-implement the 'roles' method to
do the right thing for your Database..
You can then set the store_user_class config option to 'MyApp::User',
and everything should work as expected..
Cheers
t0m
_______________________________________________
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/