Darkrp Custom Police Class

How do I make a class like swat for example, be able to acess doors that are only accessible to the cops and mayor? I know its in the shared.lua, can someone please show me an example of a shared.lua that works.