The legislation follows up on contradictory court rulings over the 2023 encroachment law, under which police can tell members of the public to stand back while they perform their duties.