Here's a short test script that adds a secondary usergroup to a user:
PHP Code:
require_once('./global.php');
// init data manager
$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_CP);
$userid = 6;
$addgroupid = 9;
$userinfo = fetch_userinfo($userid);
if (!$userinfo)
{
print_stop_message('invalid_user_specified');
}
$userdata->set_existing($userinfo);
$secondary_groups = fetch_membergroupids_array($userinfo, false);
if (!in_array($addgroupid, $secondary_groups))
{
$secondary_groups[] = $addgroupid;
$userdata->set('membergroupids', $secondary_groups);
$userdata->save();
}
echo "OK";
So you could create a user group that adds he necessary permission, then use something like this to add that group to a user as a secondary group.