A hierarchical Bayesian method is applied to the analysis of Type-Ia supernovae ( SNIa ) observations to constrain the properties of the dark matter haloes of galaxies along the SNIa lines-of-sight via their gravitational lensing effect . The full joint posterior distribution of the dark matter halo parameters is explored using the nested sampling algorithm MultiNest , which also efficiently calculates the Bayesian evidence , thereby facilitating robust model comparison . We first demonstrate the capabilities of the method by applying it to realistic simulated SNIa data , based on the real 3-year data release from the Supernova Legacy Survey ( SNLS3 ) . Assuming typical values for the parameters in a truncated singular isothermal sphere ( SIS ) halo model , we find that a catalogue analogous to the existing SNLS3 data set is typically incapable of detecting the lensing signal , but a catalogue containing approximately three times as many SNIa can produce robust and accurate parameter constraints and lead to a clear preference for the SIS halo model over a model that assumes no lensing . In the analysis of the real SNLS3 data , contrary to previous studies , we obtain only a very marginal detection of a lensing signal and weak constraints on the halo parameters for the truncated SIS model , although these constraints are tighter than those typically obtained from equivalent simulated SNIa data sets . This difference is driven by a preferred value of \eta \approx 1 in the assumed scaling-law \sigma \propto L ^ { \eta } between velocity dispersion and luminosity , which is somewhat higher than the canonical values of \eta = \tfrac { 1 } { 4 } and \eta = \tfrac { 1 } { 3 } for early and late-type galaxies , respectively .