<html><body><div style="font-family: trebuchet ms,sans-serif; font-size: 10pt; color: #330099"><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Thanks it did work!<br></div><div><br></div><div><br data-mce-bogus="1"></div><div>and Thanks again for replying so soon!<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Kind Regards<br data-mce-bogus="1"></div><div>Rajesh Mallah.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>============================<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>lib/MyProj/Schema/Result/MyProjUser.pm<br data-mce-bogus="1"></div><div><br>sub myrolecol {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my ($self) = @_;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my $log = Log::Log4perl-&gt;get_logger();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $log -&gt; debug ("myrolecol has been called!");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return "thisrole|testrole";<br><br>}<br><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>============================================<br data-mce-bogus="1"></div><div><br><br>__PACKAGE__-&gt;config-&gt;{'Plugin::Authentication'} =<br>{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default =&gt; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class =&gt; 'SimpleDB',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; user_model =&gt; 'DB::MyProjectUser',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; password_type =&gt; 'self_check',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; role_column&nbsp;&nbsp; =&gt; 'myrolecol'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>} ;<br><br>===========================================<br><br></div><div>the reason i was not able to get it was , I was using 'role_field'</div><div data-marker="__SIG_PRE__">instead of 'role_column'<br></div><div data-marker="__SIG_PRE__"><br data-mce-bogus="1"></div><div data-marker="__SIG_PRE__"><br>Regds<br><br>Rajesh Kumar Mallah.<br>Redgrape Technologies ( https://www.redgrape.tech )<br>Mobile: 09811255597, Land: 011-49044122 <br>----------------------------------------------------------------------------------------------------------<br>Opportunities are usually disguised as hard work, so most people don't recognize them<br>----------------------------------------------------------------------------------------------------------</div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Will Crawford" &lt;billcrawford1970@gmail.com&gt;<br><b>To: </b>"Catalyst" &lt;catalyst@lists.scsys.co.uk&gt;<br><b>Sent: </b>Monday, November 13, 2017 9:25:58 PM<br><b>Subject: </b>Re: [Catalyst] catalyst authorization , self_check<br></blockquote></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">On 13 November 2017 at 15:21, Rajesh Mallah &lt;mallah@redgrape.tech&gt; wrote:</blockquote><br>|&gt; Hi &nbsp;,<br>|&gt;<br>|&gt; the roles of my users cannot be represented in a table column<br>|&gt; for a separate relation . It involves some logic that can be put<br>|&gt; in a subroutine/method of my DBIx::Class schema object<br>|&gt; representing the user.<br><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">[...]</blockquote><br>|&gt; i have implemented the 'check_password' in MyProjectUser.pm<br>|&gt; and it works well. What i need is similar flexibility to specify the<br>|&gt; roles of an existing user . I cannot use role_field , &nbsp; role_relation<br><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><br>Just use role_column!<br><br>Giving the name of your subroutine/method as role_column, and making<br>sure it returns a suitable space- or comma-separated list of role<br>names, should be sufficient (a quick check of the code in<br>Catalyst::Authentication::Store::DBIx::Class::User shows it just calls<br>the method if it exists, it doesn't actually need to be a column<br>accessor).<br><br>Waiting to be proven wrong if there's code anywhere else checking that<br>it's actually a column ... :o)<br><br>_______________________________________________<br>List: Catalyst@lists.scsys.co.uk<br>Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst<br>Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/<br>Dev site: http://dev.catalyst.perl.org/<br><br></blockquote></div></div></body></html>