Revert some changes from 01227371ec2209b4df093eb8b3e5f6bed9276c62

Oops, was a bit too hastey removing all theat permissions code :P