Adding test code to debug perms