I want to limit who can use private buildings or a public pub/inn.
I think not. The closest to what you want is the iron door crafted by the engineer, which you can lock and unlock through its ui.
Can’t the Devs do the same thing to doors as they do to beds? Except maybe give up to 4 or 5 permissions to a door. Or can a modder do it?