Toggle the gates to be locked or unlocked

Greetings All,
Just wondering is there any ways to toggle the gates to be lockec or unlocked at certain spots? Like the gates at prison location, is it possible, if yes, could someone share what the natives are? Thank you!

Yes, there are natives to manipulate doors. You just have to find the right ones.