Bob Murray is a modern-day coal king, operating 13 mines and employing more than 7,000 people. He's not the kind of boss you tell to eat shit, or to kiss your ass. If you're brash enough to do so, you shouldn't expect to be working for him much longer.

That was the conventional wisdom, anyway.

On Tuesday, a judge ordered reinstatement for two coal miners who insulted Murray and were fired for it. Their offenses? One of them told Murray to eat shit. The other told Murray to kiss his ass.

And as far as the judge is concerned, the miners had a legal right to say as much. Not because they're entitled to free speech -- but because they have a right under the law to band together to improve their working conditions.

As The Huffington Post reported back in July, the case revolved around a contentious bonus program implemented at Murray Energy's Lovejoy #22 mine, in Fairview, West Virginia. Under the program, miners would earn extra pay if they avoided safety citations and accidents and hit certain production marks. Sounds great, right? Well, by offering that financial incentive, such a program could discourage miners from reporting hazards.

The workers at Lovejoy are represented by the United Mine Workers of America. The union opposed the bonus program on the grounds that it posed an inherent conflict with safety. Murray Energy launched the program anyway. Bonus checks went out in early 2015. Workers who didn't want to participate in the plan were encouraged to void their checks and return them. At least two miners went a step further.

On his voided check for $11.58, Richard Harrison, a 10-year-veteran of the mine, wrote, "Kiss My Ass Bob," and underlined "Bob" twice.

On his voided check for $3.22, Jesse Stolzenfels, a seven-year veteran, wrote, "Eat Shit Bob."

Both miners had voted against the bonus plan, believing it ran counter to safe mining practices. They also felt it was an insult for the company to implement what the union had democratically rejected. As Stolzenfels later testified, "It went against what we did as a union."

Murray Energy suspended them both with "intent to discharge." The company asserted that Harrison and Stolzenfels violated a company policy against insubordination and profanity in the workplace. Never mind that if every miner who cussed underground was disciplined for it, Murray Energy wouldn't be running coal anymore.

The two miners appealed the punishment, but an arbitrator upheld it. (There was no evidence that Murray himself had seen the checks or been aware of what was written on them, according to testimony. The suspensions were carried out by mine management.)

So Harrison and Stolzenfels took their case to the federal government. They argued that they had a right to protest an unsafe work program, and that they didn't need to be polite when they did it. They claimed that their suspensions violated mine safety law and labor law. Both laws, in their own ways, protect workers from retaliation for activism.

The miners have won every step of the way. Last year, a judge ruled that under mining law, they should be temporarily reinstated on the job; they later settled their cases, getting back pay for the time they missed and the right to return to their jobs.

The miners' favorable ruling Tuesday resolves the case before the National Labor Relations Board. They prevailed by proving two points. The first was that they were treated differently from other miners for the profanity they used -- i.e., that miners and managers routinely cussed in the mine, and so it wasn't fair to discipline Harrison and Stolzenfels for what was typically ignored. The second was that their act of protest, however foul-mouthed it may have been, was "protected concerted activity" -- i.e., that it was illegal to discipline them for it, since they were working in concert to improve their working conditions.

There was little dispute that profanity permeates the mine. According to the judge's decision, "the phrase kiss my ass' was used several times a day at the mine, and it was used by employees toward management, and vice versa." One miner testified that curse words were scrawled throughout the mine -- on vehicles, message board, boulders -- to the point where "you see it all over the place."

And profanity ran all the way up to the top. According to Harrison's testimony, Bob Murray himself was fond of cursing. In his first meeting with workers after he bought the mine, Murray told them, "These are my fucking rules, and if you don't like it, there's the fucking door." Stolzenfels testified that on another occasion, Murray scolded him for walking away from him. "Fuck you if you don't want to shake my hand," he quoted Murray as saying.

In the judge's opinion, it was also clear that in scrawling the insults on their checks, Harrison and Stolzenfels were taking part in an active protest against a bonus plan they considered unsafe. "Their voided checks and written comments were not merely personal actions in opposition to the [Murray's] implementation of the plan, but rather an attempt to protect mine safety and the contractual rights of all the employees," the judge, Thomas M. Randazzo, wrote.

Tony Oppegard, an attorney for the miners, told The Huffington Post that he didn't believe the miners were really fired for being profane or insubordinate.

"I think the real reason they fired these guys was they had the gall to criticize Bob Murray. That was the bottom line," said Oppegard, who represented the miners alongside attorney Rachel Hanna.

In an emailed statement, Murray said the judge's decision was "biased" and "meaningless," given that the miners were slated to return to work under the other settlement anyway. He lambasted the NLRB in general, saying Obama's appointees to the board "have made this agency extremely biased against businesses and an absolutely meaningless agency." (It should be noted that this decision was issued by Randazzo, an administrative law judge, and not the board members. According to his bio, Randazzo has worked at the NLRB his entire career, and the board members he has worked for were Republicans.)

Murray added that "safety is, and always has been, the absolute highest priority at Murray American Energy, Inc."

Harrison and Stolzenfels are scheduled to return to work next week.