NAME
Entities::Backend - A role providing storage for the Entities user-management/authorization system.
VERSION
version 0.4
SYNOPSIS
use Entities;
use Entities::Backend::SomeBackend;
# see synopsis at L<Entities>
DESCRIPTION
This class defines a Moose role that is to be consumed by backend classes that provide storage for the Entities user management and authorization systems. It defines a list of required methods that every class that consumes this role must implement.
REQUIRES
The following method are required by any class consuming this role:
get_user_from_id( $id )
Receives an ID for a user entity and attempts to find it in the backend. If found, returns an Entities::User object representing that user. Returns a false value if the user was not found.
get_user_from_name( $username )
Receives a username for a user entity and attempts to find it in the backend. If found, returns an Entities::User object representing that user. Returns a false value if the user was not found.
get_role( $role_name )
Receives the name of a role entity and attempts to find it in the backend. If found, returns an Entities::Role object representing that role. Returns a false value if the role was not found.
get_action( $action_name )
Receives the name of an action entity and attempts to find it in the backend. If found, returns an Entities::Action object representing that action. Returns a false value if the action was not found.
get_plan( $plan_name )
Receives the name of a plan entity and attempts to find it in the backend. If found, returns an Entities::Plan object representing that plan. Returns a false value if the plan was not found.
get_feature( $feature_name )
Receives the name of a feature entity and attempts to find it in the backend. If found, returns an Entities::Feature object representing that feature. Returns a false value if the feature was not found.
get_customer( $customer_name )
Receives the name of a customer entity and attempts to find it in the backend. If found, returns an Entities::Customer object representing that customer. Returns a false value if the customer was not found.
save( $obj )
Receives a new or existing entity object (either User, Role, Action, Plan, Customer or Feature) and saves it to the backend. Should return a true value if the save was successful or croak otherwise. To make it clear, this method should insert new objects and update existing ones.
SEE ALSO
Entities, Entities::Backend::Memory, Entities::Backend::MongoDB.
AUTHOR
Ido Perlmuter, <ido at ido50 dot net>
BUGS
Please report any bugs or feature requests to bug-entities at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Entities. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Entities::Backend
You can also look for information at:
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
LICENSE AND COPYRIGHT
Copyright 2010-2013 Ido Perlmuter.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.