Federal law does prohibit discrimination, including in advance opportunities or promotions, against the disabled. Not all mental illness or psychiatric conditions would qualify as a disability, etc.--there are elments or permanence, significant effect on everyday life, accepted diagnosis, etc. which must be met for something to be a disability.Also, all the law requires is that an employer make a "reasonable accomodation" to the disability. That is, if the person could do the job he or she wants with reasonable (not too expensive or disruptive) changes to duties or hours, or assistive devices (in the case of physical disabilities), then the company may have to let him or her do it. But if he or she couldn't do the job without an unfair level (to the company) of cost or change in responsibilities, the company doesn't need to give them the position.So the short answer is, it MAY be discrimination, if your condition would constitute a disability and if you could do the job you wanted, even with some accomodation, as long as that accomodation is reasonable. You should consult with an employment attorney who can evalute all  the specifics of your situation with you, to advise as to any rights you may have. Good luck.