[Catalyst] Installing Catalyst::Authentication::Store::DBIx::Class Breaks Catalyst

kakimoto at tpg.com.au kakimoto at tpg.com.au
Sun May 17 03:33:13 GMT 2009


Hello, all,

  What I did:

1) Downloaded a copy of the tute codes for
http://search.cpan.org/~hkclark/Catalyst-Manual-5.7021/lib/Catalyst/Manual/Tutorial/Authorization.pod
1.5) Works Very well! :D

2) Modified MyApp.pm and Schema/Users.pm, Schema/UserRoles.pm and
Schema/Roles.pm to reflect my database model. This is what my MyApp.pm
has for plugins:

# Load plugins
use Catalyst qw/-Debug
            ConfigLoader
            Static::Simple

            StackTrace

            Authentication

            Authentication::Credential::Password
            Authorization::Roles


            Session
            Session::Store::FastMmap
            Session::State::Cookie
            /;
    





3) Ran application ( DBIC_TRACE=1 perl script/myapp_server.pl ). I did
see the sql that queries the "Users" database table (which is expected)
but no other sqls that query the "UserRoles" and/or "Roles" database
table. Any idea why?


4) Can log in (authentication is OK) but can't user object can't show
the roles of the current user.
In my MyApp::Controller::Login.pm, I have the following:



  if ($c->authenticate ( {'username' => $username, 'password'=>
$password} ))
  {
#            # If successful, then let them use the application
        if ($c->check_user_roles( "admin" ))
        {
                $c->log->debug(" Admin TRACKED " );
        }
        else{
                $c->log->debug(" Admin NOT TRACKED " );
        }

       ...
 }


I keep seeing " Admin NOT TRACKED" implying that the user object is not
finding the roles.


As my application runs on a database backend, I don't think it's going
to be possible for me to include it in this post. 

I am really suspecting that  Roles Authorization (with a database
backend using Catalyst::Authentication::Store::DBIx::Class ) doesn't
work at all or is broken.
 


Question:
========
1) Anyone else having problems with using Roles Authorization (with a
database backend using Catalyst::Authentication::Store::DBIx::Class )? 
2) Any up-to-date documentation to illustrate on roles Authorization set
up using a database backend available?


I am very sorry to trouble you guys but I am really wanting to use the
Authorization plugins in Catalyst (to keep everything in my application
in the theme of Catalyst) , but after many hours , reading and trying
different methods to debug, I can't seem to get it working

Please help:)

Thank you.

K. akimoto







Quoting kakimoto at tpg.com.au:

> Hello, Collin,
> 
>  My modules are:
> 
> 
> | Catalyst::Plugin::Authentication  0.10011                          
>  
>      |
> | Catalyst::Plugin::Authentication::Credential::Password             
>  
>      |
> | Catalyst::Plugin::Authorization::Roles  0.07                       
>  
>      |
> 
\






More information about the Catalyst mailing list