Additional wrinkles:
1. Include different types of flags, so you could designate the zone as "Allow X only", or "Deny Y only", or even combinations such as "Allow anyone who is either X or Z", or "Allow anyone who is both X and Z". The combinations would actually be used most often, as your military won't be able to guard areas that they're not permitted to visit.
If an Allow flag and Deny flag are both true for the same dwarf (e.g., part of the hospital is restricted to medical dwarves only, and forbidden to those who worship a god whose spheres include Death--but then a Wound Dresser of that particular faith walks in), then the Allow flag takes precedence; the dwarf will not be made to leave the area. A modified Justice report will be issued, allowing the Sheriff to interrogate, but not actually punish, the dwarf in question.
2. Allow the same kinds of permission designation on the use of doors and levers, as well as zones.
3. Let the player to choose different levels of specificity, so you could allow/deny access based on . . .
Profession: (Profession group) / (Profession) / (Legendary in Profession) / (specific dwarf)
Faith: (Worshiper of god W) / (Priest of god W) / (specific dwarf)
Military: (any military, including mercenaries) / (fortress militia only) / (specific squad) / (squad captains) / (specific dwarf)
Citizenship: (any non-hostile) / (citizens & petitioners) / (citizens only)
Rank: (any fortress title-holder) / (noble titles only) / (officer titles only) / (specific dwarf)
Race: (any non-hostile) / (any not goblins or kobolds) / (dwarves, humans, & elves only) / (dwarves & humans only) / (dwarves only)
etc.
This would allow for things like only Legendary Jewelers and Metalcrafters having access to the Treasury, only the squad named the Imperial Corridors is permitted to guard the queen's chambers, only the clergy of a certain god may visit their most sacred shrine (while the other faithful are free to enjoy the rest of the temple). If a goblin somehow manages to join your fort, and you wanted to simulate public harassment & ridicule, you could designate major public areas as flagged against goblins, so he would keep tripping Race flags everywhere, even in areas he's allowed to be, and keep getting hauled in for questioning. Etc.