1 package Catalyst::Plugin::Authentication::Store::DBIx::Class::Backend;
5 use base qw/Class::Accessor::Fast/;
10 __PACKAGE__->mk_accessors(qw/config/);
15 my ( $class, $config, $app ) = @_;
17 ## figure out if we are overriding the default store user class
18 $config->{'store_user_class'} = (exists($config->{'store_user_class'})) ? $config->{'store_user_class'} :
19 "Catalyst::Plugin::Authentication::Store::DBIx::Class::User";
21 ## make sure the store class is loaded.
22 Catalyst::Utils::ensure_class_loaded( $config->{'store_user_class'} );
24 ## fields can be specified to be ignored during user location. This allows
25 ## the backend to ignore certain fields in the authinfo hash.
27 $config->{'ignore_fields_in_find'} ||= [ ];
38 ## let's use DBICs get_columns method to return a hash and save / restore that
39 ## from the session. Then we can respond to get() calls, etc. in most cases without
40 ## resorting to a DB call. If user_object is called, THEN we can hit the DB and
41 ## return a real object.
43 my ( $self, $c, $frozenuser ) = @_;
45 return $frozenuser if ref $frozenuser;
47 my $user = $self->config->{'store_user_class'}->new($self->{'config'}, $c);
49 return $user->from_session($frozenuser, $c);
53 my ($self, $c, $user) = @_;
55 return $user->for_session($c);
59 my ( $self, $authinfo, $c ) = @_;
61 my $user = $self->config->{'store_user_class'}->new($self->{'config'}, $c);
63 return $user->load($authinfo, $c);
69 # this can work as a class method on the user class
70 $self->config->{'store_user_class'}->supports( @_ );
79 Catalyst::Plugin::Authentication::Store::DBIx::Class::Backend - A class to ...
83 This documentation refers to version 0.01.
87 use Catalyst::Plugin::Authentication::Store::DBIx::Class::Backend;
91 The Catalyst::Plugin::Authentication::Store::DBIx::Class::Backend class implements ...
93 =head1 SUBROUTINES / METHODS
95 =head2 new (constructor)
102 Insert description of constructor here...
104 =head2 from_session (method)
110 Insert description of method here...
112 =head2 for_session (method)
118 Insert description of method here...
120 =head2 find_user (method)
126 Insert description of method here...
133 Insert description of subroutine here...
137 Modules used, version dependencies, core yes/no
147 =head1 BUGS AND LIMITATIONS
149 None known currently, please email the author if you find any.
153 L<Catalyst::Plugin::Authentication::Store::DBIC>, L<Catalyst::Plugin::Authentication>,
154 L<Catalyst::Plugin::Authorization::Roles>
158 Jason Kuri (jayk@cpan.org)
162 Copyright 2006 by Jason Kuri.
164 This software is free. It is licensed under the same terms as Perl itself.