Plans to convert a barn near Leyburn into a residential building have been given the go-ahead by the council.