9fb90eba213d7bf8cff9d88f0120a4f64b88364d
[catagits/Catalyst-Plugin-Authentication.git] / lib / Catalyst / Plugin / Authentication / User.pm
1 #!/usr/bin/perl
2
3 package Catalyst::Plugin::Authentication::User;
4
5 use strict;
6 use warnings;
7
8 sub id { die "virtual" }
9
10 sub store { die "virtual" }
11
12 sub supports {
13     my ( $self, @spec ) = @_;
14
15     my $cursor = $self->supported_features;
16
17     # traverse the feature list,
18     for (@spec) {
19         #die "bad feature spec: @spec" if ref($cursor) ne "HASH";
20         return if ref($cursor) ne "HASH";
21
22         $cursor = $cursor->{$_};
23     }
24
25     return $cursor;
26 }
27
28 __PACKAGE__;
29
30 __END__
31
32 =pod
33
34 =head1 NAME
35
36 Catalyst::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
45 This is the base class for authenticated 
46
47 =head1 METHODS
48
49 =over 4
50
51 =item id
52
53 A unique ID by which a user can be retrieved from the store.
54
55 =item store
56
57 Should return a class name that can be used to refetch the user using it's
58 ID.
59
60 =item supports
61
62 An 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