Unless you have a union agreement or employment contract that prohibits this action, then it is legal. The fact is that most employment is "at will" which means that a company can set the conditions of the workplace much as it sees fit (absent some form of legally actionable discrimination). Accordingly, a worker can be demoted (or even terminated) for any reason or no reason at all, with or without notice.