Returns the groups that the user in this request has access to.

    This function gets the user id from the auth.get_auth function, and passes
    it to the ACL callback function to get the groups.

    Args:
        request: aiohttp Request object

    Returns:
        If the ACL callback function returns None, this function returns None.
        Otherwise this function returns the sequence of group permissions
        provided by the callback, plus the Everyone group. If user_id is not
        None, the AuthnticatedUser group and the user_id are added to the
        groups returned by the function

    Raises:
        RuntimeError: If the ACL middleware is not installed

async def get_user_groups(request):
    """Returns the groups that the user in this request has access to.

    This function gets the user id from the auth.get_auth function, and passes
    it to the ACL callback function to get the groups.

    Args:
        request: aiohttp Request object

    Returns:
        If the ACL callback function returns None, this function returns None.
        Otherwise this function returns the sequence of group permissions
        provided by the callback, plus the Everyone group. If user_id is not
        None, the AuthnticatedUser group and the user_id are added to the
        groups returned by the function

    Raises:
        RuntimeError: If the ACL middleware is not installed
    """
    acl_callback = request.get(GROUPS_KEY)
    if acl_callback is None:
        raise RuntimeError('acl_middleware not installed')

    user_id = await get_auth(request)
    groups = await acl_callback(user_id)
    if groups is None:
        return None

    user_groups = (Group.AuthenticatedUser, user_id) if user_id is not None else ()

    return set(itertools.chain(groups, (Group.Everyone,), user_groups))