ported Authentication::Store::Htpasswd to Authen::Htpasswd
[catagits/Catalyst-Authentication-Store-Htpasswd.git] / lib / Catalyst / Plugin / Authentication / Store / Htpasswd / User.pm
CommitLineData
e8a7c384 1#!/usr/bin/perl
2
3package Catalyst::Plugin::Authentication::Store::Htpasswd::User;
4use base qw/Catalyst::Plugin::Authentication::User Class::Accessor::Fast/;
5
6use strict;
7use warnings;
8
3e0bbcff 9BEGIN { __PACKAGE__->mk_accessors(qw/user/) }
e8a7c384 10
11sub new {
3e0bbcff 12 my ( $class, $user ) = @_;
e8a7c384 13
3e0bbcff 14 bless { user => $user }, $class;
e8a7c384 15}
16
17sub supported_features {
18 return {
19 password => {
20 self_check => 1,
21 }
22 };
23}
24
25sub check_password {
26 my ( $self, $password ) = @_;
27
3e0bbcff 28 return $self->user->check_password( $password );
e8a7c384 29}
30
31sub roles {
32 my $self = shift;
3e0bbcff 33 split( ",", $self->user->extra_info );
e8a7c384 34}
35
36__PACKAGE__;
37
38__END__
39
40=pod
41
42=head1 NAME
43
44Catalyst::Plugin::Authentication::Store::Htpasswd::User - A user object
45representing an entry in an htpasswd file.
46
47=head1 SYNOPSIS
48
49 use Catalyst::Plugin::Authentication::Store::Htpasswd::User;
50
51=head1 DESCRIPTION
52
53=cut
54
55