[Catalyst] Pulling My Hair Out with DBIx::Schema For Authentication and Authorization

Brandon Black blblack at gmail.com
Tue Mar 21 23:29:18 CET 2006


On 3/21/06, hkclark at gmail.com <hkclark at gmail.com> wrote:
> On 3/21/06, Matt S Trout <dbix-class at trout.me.uk> wrote:
> > hkclark at gmail.com wrote:
> It's like it's not picking up the relationship to the user table...
> it's got 'username' in the WHERE clause but no join to the 'user'
> table.
>

I haven't even gotten around to using the DBIC::Schema auth/session
stuff myself yet, so I could be totally off base here, but my first
guess would be that you're missing the corresponding ->belongs_to's
that go with your ->has_many's.

If:

Role->has_many(map_user_role => 'MyApp::Db::Schema::UserRole' => 'role');
User->has_many(map_user_role => 'MyApp::Db::Schema::UserRole' => 'user');

I would expect yuo to also have:

UserRole->belongs_to(user => 'MyApp::Db::Schema::User');
UserRole->belongs_to(role => 'MyApp::Db::Schema::Role');

-- Brandon



More information about the Catalyst mailing list