consult perms and fixes unit tests