The Supreme Court is hearing argument to rule on whether Title VII of the Civil Rights Act of 1964, which prohibits employers from discriminating against workers on the basis of sex, ought to extend to sexual orientation and gender identity as well.

The swing vote looks to be Neil Gorsuch, nominated to the court by Donald Trump. Gorsuch’s comments illustrate that he’s receptive to the plaintiffs’ arguments: when a person is discriminated against because of their sexual orientation or gender identity, “Isn’t sex also in play here, and isn’t that enough?” he asked.

Quite right. The basis of discrimination against, for example, a lesbian worker is precisely that she is a woman who dates women. Sex is at the heart of the objection; the idea that women ought to date men instead is the entire rationale. If it’s already unconstitutional for an employer to discriminate against a worker because she doesn’t conform to the behavior expected of her based on her sex — for example, that she dress a certain way — then the law ought to extend to other instances of sex-related nonconformity as well.

But Gorsuch’s vote hangs in the balance. He has also said the court should “take into consideration the massive social upheaval that would be entailed” if it were to rule in favor of the plaintiffs. His political commitments may eclipse his otherwise sound interpretation of the law. If he votes with his politics and not his logic, then the plaintiffs will likely lose the case. Since many lower courts have already ruled that sex discrimination statutes apply to sexual orientation and gender identity as well, the Supreme Court ruling could form a basis for undoing many of the legal gains won by LGBTQ people in recent years.

All of that said, the fate of gay and transgender workers does not actually hinge on the Supreme Court’s ruling. While strong legal protections against discrimination are a necessary backstop, they aren’t foolproof solutions to the problem.

Think about it: the original Title VII was passed in 1964, applying not just to sex but to race, religion, and national origin. Countless women, people of color, religious minorities, and immigrants have faced discrimination in their workplaces in the fifty-five years since.

The fight against discrimination in the workplace will not be won through the courts alone. In order for workers to really stand up to discrimination en masse, they need more rights at work in general.

A union is the most powerful tool at a worker’s disposal. Employees who lack unions face discrimination all the time, and even when it’s demonstrably against the law, companies know that nonunionized workers are unlikely to muster the time, courage, or money to file a lawsuit. Companies can afford expensive lawyers, and have the power to make life hell for anyone who complains.

Add to this the fact that more and more companies are adding mandatory arbitration clauses into their employee contracts, which means that workers can’t actually sue their employers in a courtroom at all. All told, it’s tremendously difficult for an individual worker to take a powerful corporation to task for discrimination.

But union contracts are themselves legally binding. Most union contracts contain strong nondiscrimination provisions, and when an employer violates the contract in any way, the union has the ability to push back. This is true even in cases where the law hasn’t yet caught up: for example, in thirty-three states there are currently no legal protections against anti-transgender discrimination. In those states, strong union contracts are the only line of defense that transgender workers have against the whims and prejudices of bosses.

In order to protect LGBTQ workers, we therefore need to seriously expand collective bargaining rights. This will require an overhaul of labor law of the kind proposed by Democratic Party presidential candidate Bernie Sanders, whose Workplace Democracy Plan aims to clear the obstacles in labor’s path and double union membership in four years. The reforms themselves don’t immediately appear tailor-made to address anti-LGBTQ discrimination on the page, but they’ll go a long way toward helping workers both enforce the law and secure protection where the law fails them.

One of the strongest features of Sanders’s Workplace Democracy Plan — and something it contains that no other contender has proposed, including progressive opponent Elizabeth Warren — is ending at-will employment and instituting “just cause” instead. At-will employment refers to the system where a boss can fire a worker for any reason they wish.

It’s a convenient workaround for prejudiced bosses, even in states where nondiscrimination laws are on the books. They can simply declare a worker “not a good cultural fit” or some other vague justification and fire them on the spot. It’s up to the worker, then, to prove discrimination — but who has time for that when you’re scrambling for another job?

The opposite of at-will is just cause, which means employers need to demonstrate that they have a reason for firing someone that’s related to job performance. It’s a crucial step in protecting all workers from discrimination; the fact that the at-will employment regime has persisted for decades is one of the main reasons why so many people are still fired in a discriminatory fashion — even though Title VII forbids it. The just cause proposal floated by Sanders therefore must be part of any serious fight for LGBTQ rights in the workplace.

Whatever happens in the Supreme Court, the fight is far from over — for LGBTQ people, but also for women, people of color, immigrants, religious minorities, and every worker. Right now, the bosses hold almost all the cards. Nobody will truly be free from the threat of discrimination until workers hold them instead.