Court outlines ruling in 'dreadlocks' student case