[Catalyst] Role problem

Jason Kohles email at jasonkohles.com
Mon Feb 26 14:25:47 GMT 2007


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 at jasonkohles.com
http://www.jasonkohles.com/
"A witty saying proves nothing."  -- Voltaire


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070226/b4b8f3ae/attachment.htm


More information about the Catalyst mailing list