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