Using marijuana is legal in Massachusetts — but that doesn’t mean your boss has to allow it.

Business advocates say company policies about marijuana use are currently all over the map. But a bill sponsored by Sen. Jason Lewis, D-Winchester, would change that.

Lewis’ bill, S.978, would forbid employers from penalizing or discriminating against an employee or potential hire for marijuana use outside the office and off company time, as long as the employee is not impaired while working.

“I think that we shouldn’t be discriminating against adults who want to make their own decision to responsibly consume cannabis on their own time, in the same way they can consume other legal products like alcohol,” Lewis said.

Lewis’ bill would not affect employers who are required to drug test due to federal requirements. For example, trucking companies or defense contractors are federally regulated, and their employees can be subject to drug testing for marijuana use.

An employer could still fire someone who commits a marijuana crime, such as selling to minors, or who cannot perform their job or maintain certifications needed for their job due to marijuana use.

The bill is pending before a legislative committee.

Lewis, a previous vice chair of the Legislature’s marijuana policy committee, said he was swayed by Bernadette Coughlin’s story.

Coughlin oversaw kitchen staffers at a hospital Methuen. She fell and broke her wrist and was sent for a drug test. She had used a vape pen three days earlier and tested positive for marijuana. The company fired her.

Coughlin has been lobbying the state to pass a bill to protect workers from being fired for using marijuana on their personal time.

“It just seemed like something that was unfair,” Lewis said. “And if this is happening to other people, or could happen to other people in Massachusetts, we should probably take steps to prevent that from happening.”

The Supreme Judicial Court, in a 2017 decision in Cristina Barbuto vs. Advantage Sales and Marketing, ruled that an employer cannot fire or discriminate against someone for using medical marijuana.

But the court has not yet ruled on any cases related to workplace protections for marijuana for non-medical use.

Chris Geehern, a spokesman for Associated Industries of Massachusetts, which represents businesses, said company policies today are “all over the place.”

Federally regulated companies have not changed their drug testing policies, since marijuana remains illegal under federal law.

Most other companies, Geehern said, "are taking a wait and see attitude at this point.”

Geehern said some companies still drug test, but not for marijuana. Others continue to test for marijuana.

The difficulty with testing for marijuana is there is no scientifically accurate test to measure marijuana-related impairment, and THC can linger in someone’s body for days.

“You can drug test someone and you may come up with a trace of marijuana that somebody used a couple of days ago,” Geehern said. “So the real question is, is it impairing that person’s ability to run a ... machine or drive a forklift or other safety specific occupations?”

Geehern said employers must figure out how to measure impairment — for example, in a person who uses marijuana in the morning, then comes to work. “That’s the uncharted territory that employers are dealing with,” he said.

Tamsin Kaplan, an employment attorney at Davis, Malm & D'Agostine in Boston, said she thinks Massachusetts employers are becoming more comfortable dealing with marijuana, since medical marijuana has been legal since 2012.

“Really the same common sense approach applies in this situation as it did with medical marijuana,” Kaplan said. “In many ways, it’s similar to dealing with alcohol, which we’ve been dealing with for a long time.”

Kaplan said she tells clients it is appropriate to test for marijuana if there is a safety concern — for example, if a job involves driving or operating heavy equipment.

Otherwise, she tells employers to consider whether an employee is living up to expectations in performing their job. “If they do, it’s a non-issue whether they’re off premises, off work time, using recreational marijuana,” Kaplan said.

If a worker is sleeping on the job or behaving inappropriately, Kaplan says she tells company officials to address that behavior.

Under state law, there are limited circumstances under which a company can drug test employees. One of the allowed times is when an employer has a “reasonable suspicion” that an employee is using drugs.

Employment attorney Erica Flores of Skolar Abbott in Springfield said since marijuana became legal, she has seen employers beefing up their policies regarding what constitutes a “reasonable suspicion,” training human resource workers on those policies and reminding employees that they can be drug tested if they act high while on the job.

“Just like with alcohol, it’s not okay to be intoxicated where you’re working,” Flores said.

Flores added that “reasonable suspicion” policies ensure that no one is tested unless an employer already has evidence to suspect they are impaired.