Catalyst::Authentication::Store::DBI - Storage class for Catalyst Authentication using DBI use Catalyst qw(Authentication); __PACKAGE__->config->{'authentication'} = { 'default_realm' => 'default', 'realms' => { 'default' => { 'credential' => { 'class' => 'Password', 'password_field' => 'password', 'password_type' => 'hashed', 'password_hash_type' => 'SHA-1', }, 'store' => { 'class' => 'DBI', 'user_table' => 'login', 'user_key' => 'id', 'user_name' => 'name', 'role_table' => 'authority', 'role_key' => 'id', 'role_name' => 'name', 'user_role_table' => 'competence', 'user_role_user_key' => 'login', 'user_role_role_key' => 'authority', }, }, }, }; sub login :Global { my ($self, $c) = @_; my $req = $c->request(); # catch login failures unless ($c->authenticate({ 'name' => $req->param('name'), 'password' => $req->param('password'), })) { ... } ... } sub something :Path { my ($self, $c) = @_; # handle missing role case unless ($c->check_user_roles('editor')) { ... } ... } This module implements the Catalyst::Authentication API using Catalyst::Model::DBI. It uses DBI to let your application authenticate users against a database and it provides support for Catalyst::Plugin::Authorization::Roles.

new

find_user

for_session

from_session

user_supports
Simon Bertrang, <simon.bertrang@puzzworks.com> Copyright (c) 2008 PuzzWorks OHG, <http://puzzworks.com/> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.