On Feb 25, 2007, at 9:32 PM, Ivan Wills wrote:
Hi,
I'm trying to use Roles with DBIC user storage. When I try to use
$c->assert_user_roles('Admin'); I get the following error message:
Caught exception in App::JumboRewards::Controller::MyAccount->test
"DBIx::Class::ResultSet::all(): Error executing 'SELECT me.role
FROM role me LEFT JOIN member_role map_member_role ON
( map_member_role.role_id = me.role_id ) WHERE
( map_member_role.member_alias = ? AND me.role IN ( ? ) )': ERROR:
column map_member_role.member_alias does not exist"
It looks like to me something is not joining to the member table
when it should but I am not sure where to look. My setup is fairly
similar to the example given at the end of
Catalyst::Plugin::Authentication::Store::DBIC, with table and
column names changed to match my companies coding standards.
Any suggestions on what I have done wrong?
Your configuration says the userid field in the mapping class is
called 'member_alias', but your MemberRole class doesn't have a field
with that name. I suspect you wanted __PACKAGE__->config->
{authorization}->{dbic}->{user_role_user_field} = 'memeber_id';
package App::JumboRewards::Schema::MemberRole;
__PACKAGE__->add_columns( qw/member_role_id member_role_created
member_id role_id/ );
__PACKAGE__->config(
authorization => {
dbic => {
user_role_user_field => 'member_alias',
},
},
);
--
Jason Kohles
[EMAIL PROTECTED]
http://www.jasonkohles.com/
"A witty saying proves nothing." -- Voltaire
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/