refactoring + claco's bug fix
[catagits/Catalyst-Plugin-Authentication.git] / lib / Catalyst / Plugin / Authentication / User.pm
CommitLineData
06675d2e 1#!/usr/bin/perl
2
3package Catalyst::Plugin::Authentication::User;
4
5use strict;
6use warnings;
7
8sub id { die "virtual" }
9
10sub store { die "virtual" }
11
6c8b6e5e 12sub supports {
13 my ( $self, @spec ) = @_;
14
15 my $cursor = $self->supported_features;
16
17 # traverse the feature list,
18 for (@spec) {
14f98cb2 19 #die "bad feature spec: @spec" if ref($cursor) ne "HASH";
20 return if ref($cursor) ne "HASH";
6c8b6e5e 21
22 $cursor = $cursor->{$_};
23 }
24
25 return $cursor;
26}
06675d2e 27
28__PACKAGE__;
29
30__END__
31
32=pod
33
34=head1 NAME
35
36Catalyst::Plugin::Authentication::User - Base class for user objects.
37
38=head1 SYNOPSIS
39
40 package MyStore::User;
41 use base qw/Catalyst::Plugin::Authentication::User/;
42
43=head1 DESCRIPTION
44
45This is the base class for authenticated
46
47=head1 METHODS
48
49=over 4
50
51=item id
52
53A unique ID by which a user can be retrieved from the store.
54
55=item store
56
57Should return a class name that can be used to refetch the user using it's
58ID.
59
60=item supports
61
62An introspection method used to determine what features a user object has, to support credential and authorization plugins.
63
64=item
65
66=back
67
68=cut
69
70