body: First of all, I am not a lawyer, I do plan to become one however, and therefore I am very eager do some "thought experiments" in regards to law. Also I am from Latvia and I am familiar with how the law hierarchy works here. I have some very basic knowledge from my high school law lessons, about how my question works in Latvia(As mentioned on my bio, I am about to start my studies), however I am interested in hearing from both European Union setting as well as The United States. 
  So as for my question - I stumbled upon this discussion on reddit and started thinking, what if country X just passed a law that grants marijuana the same legal status as for example tobacco. A code of conduct in a workplace A objects any use of marijuana and punishes their employee for a failing a single test by a small margin by relieving him from the duty. As far as I know, in the hierarchy of law, a company's code of conduct, must comply or in other words "is under" the actual laws of employment, etc (That is at least how it works in Latvia). So unless the employee was under such an influence that would hinder his ability to work and this has been a regular occurrence; was it a lawful sacking? 
  This is my first question here, so I hope that this is an appropriate way of asking. 
  
  
  
title: Marijuana use by an employee, if it is completely legal in the particular country/state