r35585@cain (orig r5864): jayk | 2006-12-16 20:14:41 +0000
[catagits/Catalyst-Plugin-Authentication.git] / lib / Catalyst / Plugin / Authentication / User.pm
index f77fdd2..efdd6e5 100644 (file)
@@ -4,18 +4,19 @@ package Catalyst::Plugin::Authentication::User;
 
 use strict;
 use warnings;
+use base qw/Class::Accessor::Fast/;
 
+## auth_realm is the realm this user came from. 
+BEGIN {
+    __PACKAGE__->mk_accessors(qw/auth_realm/);
+}
+
+## THIS IS NOT A COMPLETE CLASS! it is intended to provide base functionality only.  
+## translation - it won't work if you try to use it directly.
 
 ## chances are you want to override this.
 sub id { shift->get('id'); }
 
-## returns the realm the user came from - not a good idea to override this.
-sub auth_realm {
-    my $self = shift;
-    $self->{'realm'};
-}
-
-
 ## this relies on 'supported_features' being implemented by the subclass.. 
 ## but it is not an error if it is not.  it just means you support nothing.  
 ## nihilist user objects are welcome here.
@@ -65,13 +66,6 @@ sub get_object {
     return shift;
 }
 
-## this is an internal routine.  I suggest you don't rely on it's presence. 
-## sets the realm the user came from.
-sub _set_auth_realm {
-    my ($self, $realmname) = @_;
-    $self->{'realm'} = $realmname;
-}
-
 ## Backwards Compatibility
 ## you probably want auth_realm, in fact.  but this does work for backwards compatibility.
 sub store {