Merge pull request #151 from University-of-Auckland/aaf-develop

Migration scripts: fix permissions handling, permission types and check for existing roles