use strict;
use warnings;
-our $VERSION = '0.1001';
+our $VERSION = '0.1004';
BEGIN { __PACKAGE__->mk_accessors(qw/user store/) }
= $self->store->ldap_bind( undef, $self->ldap_entry->dn, $password,
'forauth' );
if ( defined($ldap) ) {
+ if ($self->store->role_search_as_user) {
+ # Have to do the role lookup _now_, as this is the only time
+ # that we have the user's password/ldap bind..
+ $self->roles($ldap);
+ }
return 1;
}
else {
sub roles {
my $self = shift;
- return $self->store->lookup_roles($self);
+ my $ldap = shift;
+ $self->{_roles} ||= [$self->store->lookup_roles($self, $ldap)];
+ return @{$self->{_roles}};
}
=head2 for_session