Cached permission generation

There's no need to generate this every time a command is run.