Perhaps all that's necessary is a "class barrier" like the team barriers. You just make the special recon hallway and put a recon-only barrier on each end.
You could have a lot of fun options with some sort of secret hallway that has various one-way exits but different entrances for teams, classes, etc...
Some way to detect which class is performing an action could be interesting. I'd imagine both an "is class" and "is not class" would work to cover all needed options.
A potential use case: a path that's only accessible to recons to give them proper flanking options, or a path for guardian to let them safely engage in fights deeper into the map without worry of interception.
This could also potentially be used to ensure only one class is available for community minigames where one specific class could, in theory, break the game.