enforce note perms in comm, refactor perm code (bug 927871)