Unless you had an employment agreement guarantying your employment or limiting the grounds under which you could be fired, this is perfectly legal, unfortuately; without an employment contract (including a union agreement), you are an employee at will, and as the term implies, an employee at will may be fired at any time, for any reason, whether they are an excellent, average, or awful employee. The permission to look for a job at corporate headquarters would not carry over to protection from looking for jobs/posting for a job elsewhere.Not only this is this legal; it's common and accepted; employers regularly terminate employees who are known to be looking. The thinking--which is reasonable--is that there is a risk of distraction, of disloyalty, and of being "left in the lurch" by a sudden departure; better to get rid of the worker at the employer's own timing.Similarly, it is legal to take action against employees based on what they post in public forums, including Facebook. Only if the employer acted improperly to access the post (e.g. hacked your account) would this be an issue.In the future, don't post about job searches on Facebook or similar social media sites.