Building dispute leads to court ruling