A major court ruling has struck down protest laws that were enacted in Sydney in the wake of the Bondi shooting.