  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 {\sc 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 halo parameters in our simulations, we find that a catalogue analogous to
the existing SNLS3 data set is incapable of detecting the lensing signal, but a
catalogue containing approximately three times as many SNIa does produce robust
and accurate parameter constraints and model selection results for two halo
models: a truncated singular isothermal sphere (SIS) and a
Navarro--Frenk--White (NFW) profile, thereby validating our analysis
methodology. 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 obtained from the equivalent simulated SNIa
data set. 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, and leads to a stronger lensing effect by the halo. No detection
of a lensing signal is made for the NFW model.
