Catalyst-Model-KiokuDB

 view release on metacpan or  search on metacpan

lib/Catalyst/Authentication/Store/Model/KiokuDB/UserWrapper.pm  view on Meta::CPAN


my %supports = (
    password => 'self_check',
    roles   => ["roles"],
    session => 1,
);

sub supports {
    my ($self, @spec) = @_;

    my $cursor = \%supports;

    return 1 if @spec == 1 and $self->can($spec[0]);

    # XXX is this correct?
    for (@spec) {
        return if ref($cursor) ne "HASH";
        $cursor = $cursor->{$_};
    }

    if (ref $cursor) {
        die "Bad feature spec: '@spec'" unless ref $cursor eq "ARRAY";
        foreach my $key (@$cursor) {
            return undef unless $self->can($key);
        }
        return 1;
    }
    else {
        return $cursor;
    }
}

sub for_session {
    my $self = shift;

    # FIXME if session isa KiokuDB, no need to do anything
    return $self->directory->object_to_id($self->get_object);
}



( run in 0.219 second using v1.01-cache-2.11-cpan-4d50c553e7e )