- // Add new role to $this->currentGroupRoles and a mapping to $this->currentGroupRoleMap.
- $this->currentGroupRoles[$attrs['ID']] = $attrs;
+ $role_id = ttRoleHelper::insert(array(
+ 'group_id' => $this->current_group_id,
+ 'org_id' => $this->org_id,
+ 'name' => $attrs['NAME'],
+ 'description' => $attrs['DESCRIPTION'],
+ 'rank' => $attrs['RANK'],
+ 'rights' => $attrs['RIGHTS'],
+ 'status' => $attrs['STATUS']));
+ // Add a mapping.
+ $this->currentGroupRoleMap[$attrs['ID']] = $role_id;