def METHOD_NAME(client, resource_group_name, webpubsub_name, hub_name, connection_id, permission, group_name):
    service_client = _get_service_client(client, resource_group_name, webpubsub_name)
    res = service_client.send_request(build_grant_permission_request(hub_name, permission, connection_id, target_name=group_name))
    res.raise_for_status()