Nope, it's not a right - or rather, that right is not protected in any kind of legal document. It's not a legal right or even a legal privilege. It's just a custom that stems out of the fact that most employers are worried about employees knowing each other's salaries, because often they have multiple people doing more or less the same job for very different salaries.