A pub has been granted licensing permission to operate a converted barn as a function room despite objections from residents.