[Catalyst] Catalyst Roles With ACL

Blaine Everingham grandmasterblaine at hotmail.com
Tue Aug 14 17:12:50 GMT 2012


I am trying to get role based authorization going in my catalyst app. Howev=
er, I'm encountering difficultly on what should be an easy task.

My database basically has four tables for users

User - Main User data with foren keys to User Account(has many) and UserToR=
ole (has many)
UserAccount  - Data to store account login type (ie openid, facebook etc)
UserToRole - Linkage table from user to user role
UserRole - table with the role names.

My Package config looks like:

    ( name =3D> "Signup::Web",
      "Plugin::Authentication" =3D> {
          default_realm =3D> "facebook",
          realms =3D> {
              facebook =3D>{
                  credential =3D>{
                      class =3D> "FBConnect",
                      api_key  =3D> __PACKAGE__->config->{facebookConnect}-=
                      secret   =3D> __PACKAGE__->config->{facebookConnect}-=
                      app_name =3D> __PACKAGE__->config->{facebookConnect}-=
                  store =3D> {
                       class =3D> 'DBIx::Class',
                    user_model =3D> 'MyApp::User',
                    role_relation =3D> 'user_to_roles',
                    role_field =3D> 'title'                  =


... more auth types

When I try and run my program I get =

Failed to load user data.  You passed [ARRAY(0x39a8964)] to authenticate() =
but your user source (MyApp::User) only has these columns: [id,alias,name_f=
irst,name_last,email]   Check your authenticate() call.

Any idea on how I can load the roles?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20120814/65afb=

More information about the Catalyst mailing list