Legislation that would allow campus and private police forces to opt into line-of-duty benefits has passed the House and the Senate.