NAME

Entities::Action - A piece of code/functionality that a user entity can perform.

VERSION

version 0.5

SYNOPSIS

used internally, see L<Entities>

DESCRIPTION

An action is just a name for a piece of code or some functionality in your code, that you want to limit the availability of to certain privileged users only. An action is the basis of ability-based authorization.

NOTE: you are not meant to create action objects directly, but only through the new_action() method in Entities.

METHODS

new( name => 'someaction', [ description => 'Just some action', parent => $entities_obj, id => 123, created => $dt, modified => $other_dt ] )

Creates a new instance of this module. Only 'name' is required.

id()

Returns the ID of the action, if set.

has_id()

Returns a true value if the action has an ID attribute.

_set_id( $id )

Changes the ID of the action object to a new ID. Should only be used internally.

name()

Returns the name of the action.

description()

Returns the description text of the action.

set_description( $desc )

Changes the description of the object to the provided value.

created()

Returns a DateTime object in the time the action object has been created.

modified( [$dt] )

Returns a DateTime object in the last time the action object has been modified. If a DateTime object is provided, it will be set as the new value of this attribute.

parent()

Returns the Entities::Backend instance that stores this object.

METHOD MODIFIERS

The following list documents any method modifications performed through the magic of Moose.

after anything_that_changes_object

Automatically saves the object to the backend after any method that changed it was executed. Also updates the 'modified' attribute with the current time before saving.

SEE ALSO

Entities.

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::Action

You can also look for information at:

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.