BitAuth User Guide Version 1.0


Adding Members

Just like when assigning groups to the user, adding users to the group is done by passing an array of user_ids to the group object in the members attribute.

When Adding a Group

There are no default members when creating a group, so if you don't specify any the group will be empty. Specifying members, however, is quite simple.

$group = array(
    'name' => 'Test Group',
    'description' => 'This is a test group.',
    'members' => array(1,5,15)
);

$this->bitauth->add_group($group);

When Updating a Group

When updating a group, adding a user to a group is done exactly the same way.

$group = $this->bitauth->get_group_by_id(2);

// Add user_id 3 to members
$group->members[] = 3;

$this->bitauth->update_group(2, $group);