The fact is that there is little by way of right to privacy in the workplace. Accordningly, unless this action violated the terms of an employment contract or union agreement, it was legal. Most work reltionships are "at will" which means that a company can set the conditions of employment much as it sees fit (absent some form of legally actionble discrimination).