[Catalyst] catalyst authorization , self_check
Rajesh Mallah
mallah at redgrape.tech
Mon Nov 13 16:37:23 GMT 2017
Thanks it did work!
and Thanks again for replying so soon!
Kind Regards
Rajesh Mallah.
============================
lib/MyProj/Schema/Result/MyProjUser.pm
sub myrolecol {
my ($self) = @_;
my $log = Log::Log4perl->get_logger();
$log -> debug ("myrolecol has been called!");
return "thisrole|testrole";
}
============================================
__PACKAGE__->config->{'Plugin::Authentication'} =
{
default => {
class => 'SimpleDB',
user_model => 'DB::MyProjectUser',
password_type => 'self_check',
role_column => 'myrolecol'
}
} ;
===========================================
the reason i was not able to get it was , I was using 'role_field'
instead of 'role_column'
Regds
Rajesh Kumar Mallah.
Redgrape Technologies ( https://www.redgrape.tech )
Mobile: 09811255597, Land: 011-49044122
----------------------------------------------------------------------------------------------------------
Opportunities are usually disguised as hard work, so most people don't
recognize them
----------------------------------------------------------------------------------------------------------
| From: "Will Crawford" <billcrawford1970 at gmail.com>
| To: "Catalyst" <catalyst at lists.scsys.co.uk>
| Sent: Monday, November 13, 2017 9:25:58 PM
| Subject: Re: [Catalyst] catalyst authorization , self_check
| On 13 November 2017 at 15:21, Rajesh Mallah <mallah at redgrape.tech> wrote:
|> Hi ,
|>
|> the roles of my users cannot be represented in a table column
|> for a separate relation . It involves some logic that can be put
|> in a subroutine/method of my DBIx::Class schema object
|> representing the user.
| [...]
|> i have implemented the 'check_password' in MyProjectUser.pm
|> and it works well. What i need is similar flexibility to specify the
|> roles of an existing user . I cannot use role_field , role_relation
| Just use role_column!
| Giving the name of your subroutine/method as role_column, and making
| sure it returns a suitable space- or comma-separated list of role
| names, should be sufficient (a quick check of the code in
| Catalyst::Authentication::Store::DBIx::Class::User shows it just calls
| the method if it exists, it doesn't actually need to be a column
| accessor).
| Waiting to be proven wrong if there's code anywhere else checking that
| it's actually a column ... :o)
| _______________________________________________
| List: Catalyst at lists.scsys.co.uk
| Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
| Searchable archive:
http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
| Dev site: http://dev.catalyst.perl.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/catalyst/attachments/20171113/126879c1/attachment.htm>
More information about the Catalyst
mailing list