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

NAME

Mango::Role - Module representing a user role

SYNOPSIS

    my $roles = $provider->search;
    while (my $role = $roles->next) {
        print $role->name, $role->description;
    };

DESCRIPTION

Mango::Role represents a user role.

METHODS

add_user

Sames as "add_users".

add_users

Arguments: @users

Adds a list of users to the current role.

    $role->add_users(23, $otheruser);

See "add_users" in Mango::Provider::Roles for more details.

created

Returns the date and time in UTC the role was created as a DateTime object.

    print $role->created;

description

Arguments: $description

Gets/sets the description of the current role.

    print $role->description;

destroy

Deletes the current role.

    $role->destroy;

id

Returns the id of the current role.

    print $role->id;

name

Arguments: $name

Gets/sets the name of the current role.

    print $role->name;

remove_users

Arguments: @users

Removes a list of users from the current role.

    $role->remove_users(23, $otheruser);

See "remove_users" in Mango::Provider::Roles for more details.

remove_user

Sames as remove_users.

update

Saves any changes made to the role back to the provider.

    $role->password('Red');
    $role->update;

Whenever "update" is called, "updated" is automatically set to the current time in UTC.

updated

Returns the date and time in UTC the role was last updated as a DateTime object.

    print $role->updated;

SEE ALSO

Mango::Object, Mango::Provider::Roles

AUTHOR

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