[Catalyst] Questions with Authentication/Authorization

Tomas Doran bobtfish at bobtfish.net
Thu Nov 24 13:02:44 GMT 2011


On 24 Nov 2011, at 12:40, Johannes Kilian wrote::
> * 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 (with a session store etc) needs to be setup for  
authentication to persist across requests.

> * 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?
>
>
> I tried several things - but cannot find any solution yet ...

I think this is as your role is a single foreign key, rather than a  
link table.

Can you try again with Devel::SimpleTrace to get a full backtrace out,  
and also show us the DBIC Row classes for the two tables concerned?

Cheers
t0m




More information about the Catalyst mailing list