If you did pose a threat (or at least there was credible evidence, such as your own doctor's testimony) that you posed a threat, they may legally terminate you. While an employer must make "reasonable" accommodations to an employee's disability, including mental illness, it is not considered reasonable for an employer to have to expose its other staff or customers to danger, or itself to liability (they could be sued for a lot of money if you were to harm anyone). Therefore, if there are reasonable grounds to believe you pose a threat, they could terminate you to protect themselves and their other workers or visitors to their business.