[Catalyst] catalyst authorization , self_check

Will Crawford billcrawford1970 at gmail.com
Mon Nov 13 15:55:58 GMT 2017


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)



More information about the Catalyst mailing list