bless $self, $class;
+ if (!exists($self->config->{'id_field'})) {
+ $self->config->{'id_field'} = 'id';
+ }
## if we have lazyloading turned on - we should not query the DB unless something gets read.
## that's the idea anyway - still have to work out how to manage that - so for now we always force
}
if ($self->get_object) {
- return $self
+ return $self;
} else {
return undef;
}
my @roles = ();
if (exists($self->config->{'role_column'})) {
- @roles = split /[ ,\|]/, $self->get($self->config->{'role_column'});
+ @roles = split /[ ,\|]+/, $self->get($self->config->{'role_column'});
$self->_roles(\@roles);
} elsif (exists($self->config->{'role_relation'})) {
my $relation = $self->config->{'role_relation'};
sub for_session {
my $self = shift;
- return $self->get('id');
+ return $self->get($self->config->{'id_field'});
}
sub from_session {
# this could be a lot better. But for now it just assumes $frozenuser is an id and uses find_user
# XXX: hits the database on every request? Not good...
- return $self->load( { id => $frozenuser }, $c);
+ return $self->load( { $self->config->{'id_field'} => $frozenuser }, $c);
}
sub get {
=head1 SYNOPSIS
-use Catalyst::Plugin::Authentication::Store::DBIx::Class::User;
+Internal - not used directly. use Catalyst::Plugin::Authentication::Store::DBIx::Class::User;
+
+
+
=head1 DESCRIPTION