NAME
Elive::Entity::User - Elluminate Users entity class
DESCRIPTION
This class is used to query and maintain information on registered Elluminate Live! users.
METHODS
get_by_loginName
my $user = Elive::Entity::User->get_by_loginName('joebloggs');
Retrieve on loginName, which is a co-key for the users table.
Please note that the Elluminate Web Services raise an error if the user was not found. So, if you're not sure if the user exists:
use Try::Tiny;
my $user = try {Elive::Entity::User->get_by_loginName('joebloggs')};
insert
my $new _user = Elive::Entity::User->insert({
loginName => ...,
loginPassword => ...,
firstName => ...,
lastName => ...,
email => ...,
role => ${Elive::Entity::Role::PARTICIPANT},
)};
Insert a new user
update
my $user_obj = Elive::Entity::user->retrieve($user_id);
$user_obj->update(role => ${Elive::Entity::Role::SYSTEM_ADMIN}); # upgrade to an app admin
$user_obj->lastName('Smith');
$user_obj->update(undef, force => 1);
Update an Elluminate user. Everything can be changed, other than userId. This includes the loginName. However loginNames must all remain unique.
As a safeguard, you'll need to pass force => 1
to update: (a) users with a Role Id of 0, i.e. system administrator accounts, or (b) the login user
change_password
Implements the changePassword
SDK method.
my $user = Elive::Entity::User->retrieve($user_id);
$user->change_password($new_password);
This is equivalent to:
my $user = Elive::Entity::User->retrieve($user_id);
$user->update({loginPassword => $new_password});
delete
$user_obj->delete();
$admin_user_obj->delete(force => 1);
Delete user objects. As a safeguard, you need to pass force => 1
to delete system administrator accounts, or the login user.
Note that a deleted user, will have its deleted property immediately set, but may remain accessible for a short period of time until garbage collected.
So to check for a deleted user:
my $user = Elive::Entity::User->retrieve( $user_id );
my $user_is_deleted = !$user || $user->deleted;
RESTRICTIONS
Elluminate Live! can be configured to use LDAP for user management and authentication.
If LDAP is in use, the fetch and retrieve methods will continue to operate via the Elluminate SOAP command layer. User access becomes read-only. The affected methods are: insert
, update
, delete
and change_password
.