NAME
Elive::Entity::Group - Elluminate Group entity instance class
DESCRIPTION
Groups of users are typically used to specify session participants.
This class is used to query and maintain groups.
The members
property contains the group members as an array of user IDs or sub-group objects.
If the a site is configured for LDAP, groups are mapped to LDAP groups. Group access becomes read-only. The affected methods are: insert
, update
, and delete
.
METHODS
insert
#
# insert from an array of User Ids. Elements may be integers, strings
# and/or user objects.
#
my $alice = Elive::Entity::User->get_by_loginName('alice');
my $bob = Elive::Entity::User->get_by_loginName('bob');
my $group = Elive::Entity::Group->insert({
name => 'Elluminati',
# following are all ok
members => [111111, '222222', $alice->userId, $bob ],
},
);
#
# insert from a comma separated string of user IDs
#
my $group = Elive::Entity::Group->insert({
name => 'Elluminati',
members => '111111,222222,333333',
},
);
Inserts a new group.
update
$group->update({members => [111111,'222222', $alice->userId, $bob]});
$group->update({members => '111111,222222,333333'});
Updates an existing group.
expand_members
This is a utility method that includes the sum total of all members in the group, including those in recursively nested sub-groups. The list is further reduced to only include unique members.
my @all_members = $group_obj->expand_members();
It returns loginNames
as an array of strings.