The Senate on Tuesday unanimously passed legislation restricting businesses from requiring credit checks of potential employees.

The bill allows for credit checks under certain circumstances such as when the position has control over $6,000 in employer or third-party funds and for positions that require national security clearance.

Democrats on a 14-24 vote defeated a measure proposed by Sen. Bruce Tarr, the Republican minority leader from Gloucester, that would have added another exemption for positions with access to "personal financial information or direct access to financial accounts."

"We don't need to go this far," said Sen. Michael Barrett, a Lexington Democrat who sponsored an earlier version of the bill and argued Tarr's amendment would "substantially weaken" the legislation.

Joining the six Republicans voting for Tarr's amendment were Democrat Sens. William Brownsberger, Jennifer Flanagan, Anne Gobi, Michael Moore, Kathleen O'Connor Ives, Marc Pacheco, Michael Rush and James Timilty.

Though Tarr warned that without the amendment the bill could have "negative impacts" for small businesses, he joined his colleagues in voting for passage of the legislation (S 2394).

Violations of the bill, which would take effect January 2017, would be considered an "unfair practice" under the state's consumer protection law.