<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Feb 25, 2007, at 9:32 PM, Ivan Wills wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"> Hi,<BR> <BR> I'm trying to use Roles with DBIC user storage. When I try to use $c-&gt;assert_user_roles('Admin'); I get the following error message:<BR> <BR> <PRE wrap=""><CODE class="error">Caught exception in App::JumboRewards::Controller::MyAccount-&gt;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"

</CODE></PRE>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.<BR> <BR> Any suggestions on what I have done wrong?<BR> <BR></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>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__-&gt;config-&gt;{authorization}-&gt;{dbic}-&gt;{user_role_user_field} = 'memeber_id';</DIV><DIV> </DIV><DIV><BLOCKQUOTE type="cite"><TT>package App::JumboRewards::Schema::MemberRole;<BR>__PACKAGE__-&gt;add_columns( qw/member_role_id member_role_created member_id role_id/ );<BR></TT><BR> <TT>__PACKAGE__-&gt;config(<BR>     authorization =&gt; {<BR>         dbic =&gt; {<BR>            user_role_user_field =&gt; 'member_alias',<BR>         },<BR>     },<BR>);</TT></BLOCKQUOTE></DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>Jason Kohles</DIV><DIV><A href="mailto:email@jasonkohles.com">email@jasonkohles.com</A></DIV><DIV><A href="http://www.jasonkohles.com">http://www.jasonkohles.com</A>/</DIV><DIV>"A witty saying proves nothing."  -- Voltaire</DIV><BR class="Apple-interchange-newline"></SPAN></SPAN> </DIV><BR></BODY></HTML>