It's not clear from what you write if you were applying for a job with a new employer or applying for a new position with your current employer. In any event, unless this action violated an employment contract or union agreement it was legal. The fact is that a company can set the conditions of employment much as it sees fit. This includes not informing someone how to qualify for a job or even what the qualifications for it are. Therefore, unless your treatment constitued some form of actionable discrimination (which you did not indicate), it was legal.