def METHOD_NAME(group_spec, is_admin):
    user_ids = get_resource_ids(request.json, 'users')
    group_info = get_group_info(group_spec, need_admin=True, access_all_groups=False)
    group_uuid = group_info['uuid']
    group_owner = group_info['owner_id']
    if group_owner in user_ids:
        raise UsageError("Cannot relegate the group owner into non-admin status")
    members = set(
        m['user_id']
        for m in local.model.batch_get_user_in_group(user_id=user_ids, group_uuid=group_uuid)
    )
    for user_id in user_ids:
        if user_id in members:
            local.model.update_user_in_group(user_id, group_uuid, is_admin)
        else:
            local.model.add_user_in_group(user_id, group_uuid, is_admin)
    return request.json