
Catalyst::Authentication::Store::Fey::ORM - A storage class for Catalyst Authentication using Fey::ORM

version 0.001

use Catalyst qw(
Authentication
Authorization::Roles
);
__PACKAGE__->config->{authentication} = {
default_realm => 'members',
realms => {
members => {
credential => {
class => 'Password',
password_field => 'password',
password_type => 'clear'
},
store => {
class => 'Fey::ORM',
user_model => 'MyApp::User',
role_relation => 'roles',
role_field => 'rolename',
}
}
}
};
# Log a user in:
sub login : Global {
my ( $self, $c ) = @_;
$c->authenticate(
{
user_name => $c->req->params->{username},
password => $c->req->params->{password},
}
);
}
# verify a role
if ( $c->check_user_roles( 'editor' ) ) {
# do editor stuff
}

The Catalyst::Authentication::Store::Fey::ORM class provides access to authentication information stored in a database via Fey::ORM.

Constructs a new store object.
Revives a user from the session based on the info provided in $frozenuser. Currently treats $frozenuser as an id and retrieves a user with a matching id.
Prepares a user to be stored in the session. Currently returns the value of the user's id field (as indicated by the 'id_field' config element).
Finds a user using the information provided in the $authinfo hashref and returns the user, or undef on failure. This is usually called from the Credential. This translates directly to a call to Catalyst::Authentication::Store::Fey::ORM::User's load() method.

The Fey::ORM storage module has several configuration options.

Keedi Kim - 김도형 <keedi@cpan.org>

This software is copyright (c) 2011 by Keedi Kim.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.