NAME

Catalyst::Authentication::Store::CouchDB::User - The backing user class for the Catalyst::Authentication::Store::CouchDB storage module.

VERSION

version 0.001

DESCRIPTION

The Catalyst::Authentication::Store::CouchDB:User class implements user storage connected to a CouchDB instance.

SYNPOSIS

Internal - not used directly.

METHODS

new

Constructor. Connects to the CouchDB instance in the configuration, and fetches the design document that contains the configured view.

load ( $authinfo, $c )

Retrieves a user from storage. It queries the configured view, and converts the first document retrieved into a CouchDB document. This is then used as the User backing object

supported_features

Indicates the features supported by this class.

roles

Returns a list of roles supported by this class. These are stored as an array in the 'roles' field of the User document.

for_session

Returns a serialised user for storage in the session. This is a JSON representation of the user.

from_session ( $frozen_user )

Given the results of for_session, deserialises the user, and recreates the backing object.

get ( $fieldname )

Returns the field $fielname from the backing object.

AUTOLOAD

AUTOLOAD is defined so that calls to missing methods will get converted into a call to get for the field matching the method name. This is convenient for use inside templates, as for example user.name will now return the name field from the user document.

NOTES

This module is heavily based on Catalyst::Authentication::Store::DBIx::Class::User.

BUGS

None known, but there are bound to be some. Please email the author.

AUTHOR

Colin Bradford <cjbradford@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Colin Bradford.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.