The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mango::Catalyst::Plugin::Authentication::AnonymousUser - Custom Catalyst Authentication Anonymous User

SYNOPSIS

    use Catalyst qw/
        -Debug
        ConfigLoader
        +Mango::Catalyst::Plugin::Authentication
        Static::Simple
    /;

    my $user = $c->user;
    print $user->cart->count;

DESCRIPTION

Mango::Catalyst::Plugin::Authentication::AnonymousUser is a custom user for users that haven't yet been authenticated, i.e. 'anonymous' users.

CONSTRUCTOR

new

There should never be any reason to create one of these yourself. :-)

METHODS

cart

Returns a cart for the current user. If no cart exists, one will be created and assigned to the users current session. The same cart will be returned for a user before and after they are authenticated.

    my $cart = $c->user->cart;
    print $cart->count;
    $cart->add(...);

Normally, a Mango::Cart is returned. If you are using a custom cart model that has set its result_class to a custom subclass of Mango::Cart, that class will be used instead.

profile

Returns an anonymous profile for the current user. This profile is mostly empty except for the following fields:

    first_name: Anonymous
    last_name: User

Normally, a Mango::Profile is returned. If you are using a custom profile model that has set its result_class to a custom subclass of Mango::Profile, that class will be used instead.

roles

Returns an empty list.

supported_features

Returns an anonymous hash containing the following options:

    roles => 1,
    profiles => 1,
    carts => 1

SEE ALSO

Catalyst::Plugin::Authentication, Mango::User, Mango::Profile, Mango::Cart, Mango::Catalyst::Plugin::Authentication::Store Mango::Catalyst::Plugin::Authentication::User Mango::Catalyst::Plugin::Authentication::CachedUser Mango::Catalyst::Plugin::Authentication::AnonymousUser

AUTHOR

    Christopher H. Laco
    CPAN ID: CLACO
    claco@chrislaco.com
    http://today.icantfocus.com/blog/