added and fixed some tests for the permissions entity manager