def upsert_permissions(api, pipe_name, settings):

    """

    Convenience function to create or update pipe permissions

    Args:
        api (obj): api
        settings (dict): permission settings

    Returns:
        response (obj): server response
        data (dict): json returned by server

    """

    apiroot = api.cnxn.pipes._(pipe_name).permissions
    # for now just post to permissions
    return apiroot.post(request_body=settings)